public void TryChange_with_two_parameters(int startingValue, int fromValue, int toValue, int expectedValue, bool expectedResult) { var subject = new InterlockedInt32(startingValue); var result = subject.TryChange(fromValue, toValue); subject.Value.Should().Be(expectedValue); result.Should().Be(expectedResult); }
public void TryChange_with_one_parameter(int initialValue, int toValue, int expectedValue, bool expectedResult) { var subject = new InterlockedInt32(initialValue); var result = subject.TryChange(toValue); subject.Value.Should().Be(expectedValue); result.Should().Be(expectedResult); }
public void TryChange_with_two_parameters_should_throw_if_values_are_equal() { var subject = new InterlockedInt32(0); Action action = () => subject.TryChange(1, 1); action.ShouldThrow <ArgumentException>(); }
public void TryChange_with_two_parameters_should_throw_if_values_are_equal() { var subject = new InterlockedInt32(0); Action action = () => subject.TryChange(1, 1); action.ShouldThrow<ArgumentException>(); }