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(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(1, -2, string.Empty); }; action.Should().Throw() .WithMessage("Length must be non-negative (Parameter 'length')"); } }