public void ReturnAatf_GivenReturnIsNull_ThrowsArgumentNullException() { Action constructor = () => { var @return = new ReturnAatf(A.Dummy <Aatf>(), null); }; constructor.Should().Throw <ArgumentNullException>(); }
public async void HasAatfData_GiveAatfDoesNotHaveNilReturnAndNoOtherWeeeData_FalseShouldBeReturned() { var aatfId = Guid.NewGuid(); var returnId = Guid.NewGuid(); var @return = A.Fake <Return>(); A.CallTo(() => @return.Id).Returns(returnId); A.CallTo(() => @return.NilReturn).Returns(false); var aatf = A.Fake <Aatf>(); A.CallTo(() => aatf.Id).Returns(aatfId); var returnAatf = new ReturnAatf(aatf, @return); A.CallTo(() => context.WeeeReceived).Returns(dbContextHelper.GetAsyncEnabledDbSet(new List <WeeeReceived>())); A.CallTo(() => context.WeeeReused).Returns(dbContextHelper.GetAsyncEnabledDbSet(new List <WeeeReused>())); A.CallTo(() => context.WeeeSentOn).Returns(dbContextHelper.GetAsyncEnabledDbSet(new List <WeeeSentOn>())); A.CallTo(() => context.ReturnAatfs).Returns(dbContextHelper.GetAsyncEnabledDbSet(new List <ReturnAatf>() { returnAatf })); A.CallTo(() => context.Returns).Returns(dbContextHelper.GetAsyncEnabledDbSet(new List <Return>() { @return })); A.CallTo(() => context.Aatfs).Returns(dbContextHelper.GetAsyncEnabledDbSet(new List <Aatf>() { aatf })); var result = await dataAccess.HasAatfData(aatfId); result.Should().BeFalse(); }