public async Task DeleteTransactionTypeAsync_Successfully_Deleted() { //Arrange var id = 1; var service = new TransactionTypeService(_myRestaurantContext); //Act var dbTransactionType = await service.GetTransactionTypeAsync(d => d.Id == id); await service.DeleteTransactionTypeAsync(dbTransactionType !); var result = await service.GetTransactionTypeAsync(d => d.Id == id); //Assert result.Should().BeNull(); }
public async Task UpdateTransactionTypeAsync_Successfully_Updated() { //Arrange var id = 4; var service = new TransactionTypeService(_myRestaurantContext); //Act var dbTransactionType = await service.GetTransactionTypeAsync(d => d.Id == id); dbTransactionType !.Type = "Mortgage/Rent"; await service.UpdateTransactionTypeAsync(dbTransactionType); var result = await service.GetTransactionTypeAsync(d => d.Id == id); //Assert result.Should().BeAssignableTo <TransactionType>(); result !.Id.Should().Be(id); result.Type.Should().Be("Mortgage/Rent"); }
public async Task GetTransactionTypeAsync_Returns_Null() { //Arrange var id = 1001; var service = new TransactionTypeService(_myRestaurantContext); //Act var result = await service.GetTransactionTypeAsync(d => d.Id == id); //Assert result.Should().BeNull(); }
public async Task GetTransactionTypeAsync_Returns_TransactionType() { //Arrange var id = 1; var service = new TransactionTypeService(_myRestaurantContext); //Act var result = await service.GetTransactionTypeAsync(d => d.Id == id); //Assert result.Should().BeAssignableTo <TransactionType>(); result !.Id.Should().Be(id); result.Type.Should().Be("Food"); }