public async Task ReadByIdAsync_Return_Null() { //Setup FinanceDbContext dbContext = GetDbContext(GetCurrentAsyncMethod()); Mock <IServiceProvider> serviceProviderMock = GetServiceProvider(); var vBRealizationService = new VBRealizationService(dbContext, serviceProviderMock.Object); VBRealizationWithPOService vBRealizationWithPOService = new VBRealizationWithPOService(dbContext, serviceProviderMock.Object); //Act var result = await vBRealizationService.ReadByIdAsync(1); //Assert Assert.NotNull(result); Assert.Null(result.Item1); }
public async Task ReadByIdAsync_withPO_Return_Success() { //Setup FinanceDbContext dbContext = GetDbContext(GetCurrentAsyncMethod()); Mock <IServiceProvider> serviceProviderMock = GetServiceProvider(); var vBRequestDocumentService = new VBRequestDocumentService(dbContext, serviceProviderMock.Object); var vBRequestDocumentData = GetDataUtil(vBRequestDocumentService).GetTestData_VBRequestDocumentWithPO(); var vBRealizationService = new VBRealizationService(dbContext, serviceProviderMock.Object); VBRealizationWithPOService vBRealizationWithPOService = new VBRealizationWithPOService(dbContext, serviceProviderMock.Object); var vBRealizationDocumenData = GetDataUtil(vBRealizationWithPOService).GetTestData_TanpaNomorVB(); //Act var result = await vBRealizationService.ReadByIdAsync(vBRealizationDocumenData.Id); //Assert Assert.NotNull(result); }