public async Task GivenInventoryWithoutAvailablity_WhenCorrectStockToLowerCapacity_ThenReturnsBadRequest() { var langnau = Location.At("Langnau"); GivenPuchInventory("Langnau", stock: 5, damaged: 3, used: 2); var newStock = PatchAmount.With(2); var result = await _sut.CorrectMaterialStock(CompanyName, PuchSapNr, langnau.Name, newStock); result.Should().BeOfType <BadRequestObjectResult>("you are not allowed to correct stock to lower number than (used + damaged) please redistribute"); }
public async Task GivenNoIventory_WhenCallCorrectStock_ThenReturnsBadRequest() { var langnau = Location.At("Langnau"); var company = Company.With(CompanyName, new List <Location> { langnau }); await _materialDispositionContext.Companies.InsertOneAsync(company); var newStock = PatchAmount.With(5); var result = await _sut.CorrectMaterialStock(CompanyName, PuchSapNr, langnau.Name, newStock); result.Should().BeOfType <BadRequestObjectResult>("you are not allowed to correct stock without initial inventory"); }