feat: work on day 11 part 1
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
namespace PlutonianPebbles.Tests;
|
||||
|
||||
public class ObserverTests
|
||||
{
|
||||
private static readonly string[] ExampleInput = ["125", "17"];
|
||||
|
||||
[Test]
|
||||
[MethodDataSource(nameof(BlinkTestCases))]
|
||||
public async Task Blink_WhenCalled_ItShouldReturnExpectedValue(BlinkTestCase testCase)
|
||||
{
|
||||
var stones = testCase.Stones.Select(Stone.From).ToList();
|
||||
var observer = Observer.Of(stones);
|
||||
|
||||
var result = observer.Blink(testCase.NumberOfBlinks);
|
||||
|
||||
await Assert.That(result).IsEqualTo(testCase.ExpectedLineOfStones);
|
||||
}
|
||||
|
||||
public static IEnumerable<Func<BlinkTestCase>> BlinkTestCases()
|
||||
{
|
||||
yield return () => new(ExampleInput, 0, "125 17");
|
||||
}
|
||||
|
||||
public record BlinkTestCase(string[] Stones, int NumberOfBlinks, string ExpectedLineOfStones);
|
||||
}
|
||||
Reference in New Issue
Block a user