public void Running_ShouldBe_Origin_Running(bool value) { // Arrange _origin.Running().Returns(value); var subject = new SafeService(_origin); // Act var result = subject.Running(); // Assert result.Should().Be(value); }
public void Running_ShouldPass_NotExpectedException() { // Arrange var exception = new Exception(); _origin.Running().Throws(exception); var subject = new SafeService(_origin); // Act Action action = () => subject.Running(); // Assert action.Should().ThrowExactly <Exception>(); }
public void Running_ShouldBeFalse_WhenOriginThrows_ExpectedException(Type exceptionType) { // Arrange var exception = (Exception)Activator.CreateInstance(exceptionType); _origin.Running().Throws(exception); var subject = new SafeService(_origin); // Act var result = subject.Running(); // Assert result.Should().BeFalse(); }