chore: initial git load of code space
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Strata.SqlTools.SqlBreakdown.Enums.SQL;
|
||||
using Strata.SqlTools.Statements.SqlServer;
|
||||
|
||||
namespace Strata.SqlTools.SqlBreakdown.Tests.SqlServer;
|
||||
|
||||
[TestFixture]
|
||||
public class StatementReaderTests
|
||||
{
|
||||
[Test]
|
||||
public void StatementReader_ParsesCalculationString()
|
||||
{
|
||||
// Arrange
|
||||
var calculationString = "(1 + 2) / sum([586883]) + sum([586664]) - sum([586664_1]) * 2.3";
|
||||
var sqlReader = new StatementReader(calculationString);
|
||||
var tokens = new List<(TokenType Type, string Value)>();
|
||||
|
||||
// Act
|
||||
while (sqlReader.Read())
|
||||
{
|
||||
tokens.Add((sqlReader.TokenType, sqlReader.TokenValue));
|
||||
}
|
||||
|
||||
// Assert
|
||||
Assert.That(tokens, Is.Not.Empty);
|
||||
Assert.That(tokens[0].Type, Is.EqualTo(TokenType.LeftParenthesis));
|
||||
Assert.That(tokens[1].Type, Is.EqualTo(TokenType.Number));
|
||||
Assert.That(tokens[1].Value, Is.EqualTo("1"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user