public void TestResetDtoGenericActionsDtoOutNotInBad() { //SETUP var service = new ActionService <IBizActionInOut>(_emptyDbContext, new BizActionInOut(), _mapper, _noCachingConfig); var data = new ServiceLayerBizOutDto(); //ATTEMPT var ex = Assert.Throws <InvalidOperationException>(() => service.ResetDto(data)); //VERIFY ex.Message.ShouldEqual("Indirect copy to biz action. from type = ServiceLayerBizOutDto, to type BizDataIn. Expected a DTO of type GenericActionToBizDto<BizDataIn,ServiceLayerBizOutDto>"); }
public async Task TestResetDtoGenericActionsDtoOutNotInBad() { //SETUP var service = new ActionServiceAsync <IBizActionInOutAsync>(_emptyDbContext, new BizActionInOutAsync(), _wrappedConfig); var data = new ServiceLayerBizOutDto(); //ATTEMPT var ex = await Assert.ThrowsAsync <InvalidOperationException>(async() => await service.ResetDtoAsync(data)); //VERIFY ex.Message.ShouldEqual("Indirect copy to biz action. from type = ServiceLayerBizOutDto, to type BizDataIn. Expected a DTO of type GenericActionToBizDto<BizDataIn,ServiceLayerBizOutDto>"); }