public async Task D_A_UseService_ServiceSucceeds_Succeeds() { var service = new Mock<IService>(); var sut = new Sut { Service = service.Object }; await sut.UseServiceAsync(); }
public async Task C_D_FakeItEasyWorksGreatOutOfTheBox() { var service = A.Fake<IService>(); var sut = new Sut { Service = service }; await sut.UseServiceAsync(); }
public async Task C_E_NSubstituteWorksGreatOutOfTheBox() { var service = Substitute.For<IService>(); var sut = new Sut { Service = service }; await sut.UseServiceAsync(); }
public async Task C_A_MSTestDefaultBehaviorIsNotGoodForAsyncStubs() { var service = new SystemUnderTest.Fakes.StubIService(); var sut = new Sut { Service = service }; await sut.UseServiceAsync(); }
public async Task C_C_MoqWorksGreatOutOfTheBox() { var service = new Mock<IService>(); var sut = new Sut { Service = service.Object }; await sut.UseServiceAsync(); }
public async Task C_B_ButMSTestDefaultStubBehaviorCanBeChanged() { var service = new SystemUnderTest.Fakes.StubIService { InstanceBehavior = new AsyncAwareDefaultValueStubBehavior() }; var sut = new Sut { Service = service }; await sut.UseServiceAsync(); }
public async Task D_B_UseService_ServiceFails_PropagatesException() { var service = new Mock<IService>(); var exception = new Exception("Test failure."); service.Setup(x => x.DoSomethingAsync()).Returns(Task.FromException(exception)); var sut = new Sut { Service = service.Object }; var resultException = await AsyncAssert.ThrowsAsync<Exception>(async () => await sut.UseServiceAsync()); Assert.AreSame(exception, resultException); }
public async Task A_D_SoTheFirstOneShouldHaveBeenLikeThis() { var sut = new Sut(); await sut.SuccessAsync(); }
public async Task A_C_OhThatsBetter() { var sut = new Sut(); await sut.FailAsync(); }
public void A_B_WaitAMinuteThisIsntSupposedToPass() { var sut = new Sut(); sut.FailAsync(); }
public void A_A_MyFirstAsyncTestMethod() { var sut = new Sut(); sut.SuccessAsync(); }
public async Task B_B_NewStyleRequiresABitOfHelpForNow() { var sut = new Sut(); await AsyncAssert.ThrowsAsync<Exception>(() => sut.FailAsync()); }
public async Task B_A_OldSchoolExceptionAttributeWorks() { var sut = new Sut(); await sut.FailAsync(); }