public async Task <TransferInDoc> GetTestData() { var data = await GetNewData(); await facade.Create(data, "Unit Test"); return(data); }
public async Task Should_Success_Create_Data() { TransferFacade facade = new TransferFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var model = await dataUtil(facade, GetCurrentMethod()).GetNewData(); var Response = await facade.Create(model, USERNAME); Assert.NotEqual(0, Response); }
//[Fact] public async Task Should_Success_Create_Data() { SPKDocsControllerFacade spkDocsControllerFacade = new SPKDocsControllerFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); await spkDocsControllerFacade.Create(this.ViewModel, "username", "Bearer"); TransferFacade facade = new TransferFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var model = await dataUtil(facade, GetCurrentMethod()).GetNewData2(); var Response = await facade.Create(model, USERNAME); Assert.NotEqual(0, Response); }
public async Task Should_Success_Create_Data_2() { DbSet <Inventory> dbSetInventory = _dbContext(GetCurrentMethod()).Set <Inventory>(); Inventory inventory = new Inventory { ItemArticleRealizationOrder = "art1", ItemCode = "code", ItemDomesticCOGS = 0, ItemDomesticRetail = 0, ItemDomesticSale = 0, ItemDomesticWholeSale = 0, ItemId = 1, ItemInternationalCOGS = 0, ItemInternationalRetail = 0, ItemInternationalSale = 0, ItemInternationalWholeSale = 0, ItemName = "name", ItemSize = "size", Quantity = 1, ItemUom = "uom", StorageCode = "code", StorageId = 1, StorageIsCentral = false, StorageName = "name", }; dbSetInventory.Add(inventory); var Created = _dbContext(GetCurrentMethod()).SaveChangesAsync(); TransferFacade facade = new TransferFacade(GetServiceProvider().Object, _dbContext(GetCurrentMethod())); var model = await dataUtil(facade, GetCurrentMethod()).GetNewData(); model.DestinationId = inventory.StorageId; model.DestinationName = inventory.StorageName; model.DestinationCode = inventory.StorageCode; foreach (var item in model.Items) { item.ItemId = inventory.ItemId; } var Response = await facade.Create(model, USERNAME); Assert.NotEqual(0, Response); }