tests: add tests for actual puzzle input
This commit is contained in:
@@ -6,7 +6,10 @@ public class UnitTest1
|
||||
[MemberData(nameof(TestData.OasisReportParseTestData), MemberType = typeof(TestData))]
|
||||
public void Parse_GivenAReportInput_ItShouldReturnExpectedOasisReportInstance(string[] input, OasisReport expected)
|
||||
{
|
||||
OasisReport.Parse(input).Should().BeEquivalentTo(expected);
|
||||
OasisReport
|
||||
.Parse(input)
|
||||
.Should()
|
||||
.BeEquivalentTo(expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -19,11 +22,37 @@ public class UnitTest1
|
||||
"10 13 16 21 30 45",
|
||||
};
|
||||
|
||||
OasisReport.Parse(input).CalculateSumOfNextValues().Should().Be(114);
|
||||
OasisReport
|
||||
.Parse(input)
|
||||
.CalculateSumOfNextValues()
|
||||
.Should()
|
||||
.Be(114);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CalculateSumOfNextValues_WhenGivenInput_ItShouldReturnTheSumOfAllNextValues()
|
||||
{
|
||||
OasisReport
|
||||
.Parse(TestData.Input)
|
||||
.CalculateSumOfNextValues()
|
||||
.Should()
|
||||
.Be(2175229206);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CalculateSumOfNextValues_WhenGivenInputAndBackwardsIsTrue_ItShouldReturnTheSumOfAllNextValues()
|
||||
{
|
||||
OasisReport
|
||||
.Parse(TestData.Input)
|
||||
.CalculateSumOfNextValues(true)
|
||||
.Should()
|
||||
.Be(942);
|
||||
}
|
||||
|
||||
public static class TestData
|
||||
{
|
||||
public static readonly string[] Input = File.ReadAllLines("INPUT.txt");
|
||||
|
||||
public static IEnumerable<object[]> OasisReportParseTestData =>
|
||||
new List<object[]>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user