public void DynamicAdderSetsOverflowHigh() { //Given const int inputA = 128; const int inputB = 128; var adder = new DynamicAdder(8); //When adder.InputA.Set(inputA); adder.InputB.Set(inputB); //Then adder.Overflow.State.Should().BeTrue(); }
public void DynamicAdderSumsCorrectly() { //Given const int inputA = 23; const int inputB = 56; const int expectedSum = inputA + inputB; var adder = new DynamicAdder(8); //When adder.InputA.Set(inputA); adder.InputB.Set(inputB); //Then var actualSum = adder.Sum.Read(); actualSum.Should().Be(expectedSum); adder.Overflow.State.Should().BeFalse(); }