public async void ItShouldRemoveLocationInventoryRecord() { //Given EFCoreLocationRepository locationRepo = new EFCoreLocationRepository(ctx); //When LocationInventory tempLocationInventory = await locationRepo.AddLocationInventory(mockLocationInventory); await locationRepo.RemoveLocationInventoryRecord(tempLocationInventory.ID); //Then Assert.Empty(await locationRepo.GetAllLocationInventoryRecords()); }
public async void ItShouldFindTheInventoryByLocationAndProductname() { //Given EFCoreLocationRepository locationRepo = new EFCoreLocationRepository(ctx); //When await locationRepo.AddLocationInventory(mockLocationInventory); //Then LocationInventory actualLocationInventory = await locationRepo.GetLocationInventoryByProductAndLocationName(mockLocation.Name, mockProduct.Name); Assert.Equal(1, actualLocationInventory.Quanitity); }
public async void ItShouldRestockInventory() { //Given EFCoreLocationRepository locationRepo = new EFCoreLocationRepository(ctx); //When await locationRepo.AddLocationInventory(mockLocationInventory); await locationRepo.RemoveInventory(-1, mockLocation.Name, mockProduct.Name); //Then LocationInventory actualLocationInventory = await locationRepo.GetLocationInventoryByProductAndLocationName(mockLocation.Name, mockProduct.Name); Assert.Equal(2, actualLocationInventory.Quanitity); }