public void AddStockItem_InValidRequest_DuplicateStockId() { StockProcessRepository repo = new StockProcessRepository(dbctxt); StockInfo info = new StockInfo(); info.StockId = 7; info.Name = "JBL GO2 Speaker"; info.Price = 2166.00M; info.ProductType = "Electronics"; info.Rating = 4; info.AvailabilityStatus = "Yes"; string result = repo.AddStockItem(info).Result; Assert.Equal("Trying to add Duplicate StocckId.Kindly recheck the Id to be updated", result); }
public void AddStockItem_ValidRequest() { StockProcessRepository repo = new StockProcessRepository(dbctxt); StockInfo info = new StockInfo(); info.StockId = 21; info.Name = "JBL GO2 Speaker"; info.Price = 2166.00M; info.ProductType = "Electronics"; info.Rating = 4; info.AvailabilityStatus = "Yes"; string result = repo.AddStockItem(info).Result; Assert.Equal(result, GlobalConstants.Success); }