public async Task <BankCashReceiptModel> GetTestData_LOKAL() { BankCashReceiptModel model = GetNewData(); await Service.CreateAsync(model); return(await Service.ReadByIdAsync(model.Id)); }
public async Task Should_Success_Create_Data() { //Arrange var dbContext = GetDbContext(GetCurrentAsyncMethod()); var serviceProviderMock = GetServiceProvider(); var httpClientService = new Mock <IHttpClientService>(); serviceProviderMock .Setup(serviceProvider => serviceProvider.GetService(typeof(IHttpClientService))) .Returns(httpClientService.Object); serviceProviderMock .Setup(serviceProvider => serviceProvider.GetService(typeof(FinanceDbContext))) .Returns(dbContext); var service = new BankCashReceiptService(serviceProviderMock.Object); var model = _dataUtil(service, GetCurrentAsyncMethod()).GetNewData(); var model2 = _dataUtil(service, GetCurrentAsyncMethod()).GetNewData(); model2.CurrencyCode = "USD"; //Act var Response = await service.CreateAsync(model); var Response2 = await service.CreateAsync(model2); //Assert Assert.NotEqual(0, Response); Assert.NotEqual(0, Response2); }