Пример #1
0
        public async Task CanHArdDeleteQuestion()
        {
            // Arrange:
            var toDelete = await _sut.Get().FirstOrDefaultAsync();

            int affected = toDelete.Answers.Count();

            // Act:
            var result = await _sut.DeleteHardAsync(toDelete.Id);

            // Assert:
            var deleted = await _sut.Get().FirstOrDefaultAsync(x => x.Id == toDelete.Id);

            Assert.Null(deleted);
            Assert.Equal(1 + affected, result);
        }
Пример #2
0
        public async Task CanHArdDeleteAnswer()
        {
            // Arrange:
            var toDelete = await _sut.Get().FirstOrDefaultAsync();

            // Act:
            var result = await _sut.DeleteHardAsync(toDelete.Id);

            // Assert:
            var deleted = await _sut.Get().FirstOrDefaultAsync(x => x.Id == toDelete.Id);

            Assert.Null(deleted);
            Assert.Equal(1, result);
        }
Пример #3
0
 public async Task <int> DeleteHardAsync(int id)
 {
     return(await _dal.DeleteHardAsync(id));
 }