feat: solved day 3

This commit is contained in:
Stevan Freeborn
2024-12-03 23:50:01 -06:00
parent 0a7b6b2291
commit d658c31ffe
9 changed files with 225 additions and 15 deletions
@@ -0,0 +1,38 @@
namespace MullItOver.Tests;
public class InstructionExtensionsTests
{
[Test]
public async Task Execute_WhenCalledWithNoConditionals_ItShouldReturnCorrectSum()
{
var instructions = new List<Instruction>()
{
new MulInstruction(2, 4),
new MulInstruction(5, 5),
new MulInstruction(11, 8),
new MulInstruction(8, 5),
};
var result = instructions.Execute();
await Assert.That(result).IsEqualTo(161);
}
[Test]
public async Task Execute_WhenCalledWithConditionals_ItShouldReturnCorrectSum()
{
var instructions = new List<Instruction>()
{
new MulInstruction(2, 4),
new DontInstruction(),
new MulInstruction(5, 5),
new MulInstruction(11, 8),
new DoInstruction(),
new MulInstruction(8, 5),
};
var result = instructions.Execute();
await Assert.That(result).IsEqualTo(48);
}
}