chore: initial git load of code space
This commit is contained in:
+54
@@ -0,0 +1,54 @@
|
||||
using Strata.SqlTools.SqlBreakdown.Classes;
|
||||
|
||||
namespace Strata.SqlTools.SqlBreakdown.Tests.SqlBreakdownCollectionTests;
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for SqlBreakdownCollection with custom separators.
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class SqlBreakdownCollectionSeparatorTests : SqlBreakdownCollectionTestBase
|
||||
{
|
||||
[Test]
|
||||
public void ParseBatch_WithSemicolonSeparator_ParsesSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
var collection = new SqlBreakdownCollection();
|
||||
var batchSql = @"
|
||||
SELECT * FROM Users
|
||||
;
|
||||
SELECT * FROM Orders
|
||||
;
|
||||
SELECT * FROM Products
|
||||
";
|
||||
|
||||
// Act
|
||||
collection.ParseBatch(batchSql, ";");
|
||||
|
||||
// Assert
|
||||
Assert.That(collection.Count, Is.EqualTo(3));
|
||||
Assert.That(collection.GetRawStatementAt(0), Does.Contain("Users"));
|
||||
Assert.That(collection.GetRawStatementAt(1), Does.Contain("Orders"));
|
||||
Assert.That(collection.GetRawStatementAt(2), Does.Contain("Products"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParseBatch_WithCustomSeparator_ParsesSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
var collection = new SqlBreakdownCollection();
|
||||
var batchSql = @"
|
||||
INSERT INTO Users VALUES (1, 'John')
|
||||
~~~
|
||||
INSERT INTO Users VALUES (2, 'Jane')
|
||||
~~~
|
||||
INSERT INTO Users VALUES (3, 'Bob')
|
||||
";
|
||||
|
||||
// Act
|
||||
collection.ParseBatch(batchSql, "~~~");
|
||||
|
||||
// Assert
|
||||
Assert.That(collection.Count, Is.EqualTo(3));
|
||||
Assert.That(collection.RawStatements.Count, Is.EqualTo(3));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user