public async Task UpdateShouldSucceed() { var itemToUpdate = new Domain.Entities.CostType() { CostTypeId = 2, CostTypeDescription = "new desc" }; var result = await _costTypeService.Update(itemToUpdate); result.CostTypeDescription.Should().BeEquivalentTo(itemToUpdate.CostTypeDescription); }
public void UpdateShouldThrowError() { var itemToUpdate = new Domain.Entities.CostType() { CostTypeId = 9, CostTypeDescription = "new desc" }; Func <Task> func = async() => await _costTypeService.Update(itemToUpdate); func.Should().Throw <KeyNotFoundException>(); }
public async Task AddShouldSucceed() { var itemToAdd = new Domain.Entities.CostType() { CostTypeDescription = "new item" }; var result = await _costTypeService.Add(itemToAdd); result.CostTypeDescription.Should().BeEquivalentTo(itemToAdd.CostTypeDescription); }