public async void Should_Success_Create_Data() { var serviceProvider = new Mock <IServiceProvider>(); UnitPaymentQuantityCorrectionNoteFacade facade = new UnitPaymentQuantityCorrectionNoteFacade(serviceProvider.Object, _dbContext(GetCurrentMethod())); var modelLocalSupplier = _dataUtil(facade, GetCurrentMethod()).GetNewData(); var ResponseLocalSupplier = await facade.Create(modelLocalSupplier, USERNAME, 7); Assert.NotEqual(ResponseLocalSupplier, 0); var modelImportSupplier = _dataUtil(facade, GetCurrentMethod()).GetNewData(); var ResponseImportSupplier = await facade.Create(modelImportSupplier, USERNAME, 7); Assert.NotEqual(ResponseImportSupplier, 0); }
public async Task <UnitPaymentCorrectionNote> GetTestData() { var data = GetNewData(); await facade.Create(data, "Unit Test", 7); return(data); }
public async Task Should_Error_Create_Data_Null_Parameter() { UnitPaymentQuantityCorrectionNoteFacade facade = new UnitPaymentQuantityCorrectionNoteFacade(GetServiceProvider(GetCurrentMethod()).Object, _dbContext(GetCurrentMethod())); Exception exception = await Assert.ThrowsAsync <Exception>(() => facade.Create(null, USERNAME, 7)); Assert.Equal("Object reference not set to an instance of an object.", exception.Message); }
public async Task Should_Success_Create_Data() { var dbContext = _dbContext(GetCurrentMethod()); var serviceProvider = GetServiceProvider(GetCurrentMethod(), dbContext).Object; UnitPaymentQuantityCorrectionNoteFacade facade = new UnitPaymentQuantityCorrectionNoteFacade(serviceProvider, dbContext); var modelLocalSupplier = await _dataUtil(facade, dbContext, serviceProvider).GetNewData(); var ResponseLocalSupplier = await facade.Create(modelLocalSupplier, USERNAME, 7); Assert.NotEqual(0, ResponseLocalSupplier); var modelImportSupplier = await _dataUtil(facade, dbContext, serviceProvider).GetNewData(); var ResponseImportSupplier = await facade.Create(modelImportSupplier, USERNAME, 7); Assert.NotEqual(0, ResponseImportSupplier); }
public async Task Should_Success_Create_Data_when_Supplier_Is_not_Null() { var dbContext = _dbContext(GetCurrentMethod()); UnitPaymentQuantityCorrectionNoteFacade facade = new UnitPaymentQuantityCorrectionNoteFacade(GetServiceProvider(GetCurrentMethod()).Object, _dbContext(GetCurrentMethod())); var modelLocalSupplier = await _dataUtil(facade, dbContext, GetCurrentMethod()).GetNewData(); modelLocalSupplier.SupplierId = "670"; var ResponseImportSupplier = await facade.Create(modelLocalSupplier, USERNAME, 7); Assert.NotEqual(0, ResponseImportSupplier); }