public void WhenEnforceCapacityRequiresSpaceItIsAdded_Either() { //arrange tested = new RemainingCapacity(new MutableInteger(-12)); //act tested.EnforceCapacity_A(); //assert Assert.AreEqual(0, tested.GetRemainingCapacity()); }
public void WhenEnforceCapacityRequiresSpaceItIsAdded_A() { //arrange Mock <MutableInteger> mockMutableInteger = new Mock <MutableInteger>(); mockMutableInteger.Setup(mock => mock.GetCurrentValue()).Returns(-12); tested = new RemainingCapacity(mockMutableInteger.Object); //act tested.EnforceCapacity_A(); //assert mockMutableInteger.Verify(mock => mock.Subtract(-12), Times.Once()); }