Initial commit

This commit is contained in:
github-classroom[bot] 2025-06-03 15:18:01 +00:00 committed by GitHub
commit 4b1294b32d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 5134 additions and 0 deletions

View file

@ -0,0 +1,32 @@
using MathInterpreter.Core;
namespace MathInterpreter.Test;
public sealed class ScanResultTests
{
[Fact]
public void ScanResult_Construction_Valid()
{
const int ExpectedValue = -123;
const int ExpectedLength = 3;
const string ExpectedRemainingExpression = "abc";
var result = new ScanResult<int>(ExpectedValue, ExpectedLength, ExpectedRemainingExpression);
result.Value.Should().Be(ExpectedValue);
result.Length.Should().Be(ExpectedLength);
result.RemainingExpression.ToString().Should().Be(ExpectedRemainingExpression);
}
[Fact]
public void ScanResult_Construction_Invalid()
{
var action = () =>
{
var _ = new ScanResult<int>(1, -2, string.Empty);
};
action.Should().Throw<ArgumentOutOfRangeException>()
.WithMessage("Length must be non-negative (Parameter 'length')");
}
}