public async Task Delete_InvalidInput_ReturnsFalse(int id) { #region Arrange var dbContext = new ApplicationDbContext(_dbContextOptions); await dbContext.Database.EnsureDeletedAsync(); var appPerson = new Person(dbContext); #endregion #region Act var actual = await appPerson.Delete(id); #endregion #region Assert Assert.False(actual); #endregion }
public async Task Delete_ValidInput_ReturnsTrue(int id) { #region Arrange var dbContext = new ApplicationDbContext(_dbContextOptions); await dbContext.Database.EnsureDeletedAsync(); dbContext.Persons.Add(new Domain.Person()); await dbContext.SaveChangesAsync(); var appPerson = new Person(dbContext); #endregion #region Act var actual = await appPerson.Delete(id); #endregion #region Assert Assert.True(actual); #endregion }