예제 #1
0
        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
        }
예제 #2
0
        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
        }