Esempio n. 1
0
        public void DeleteComment_WhenEmptyContext_ReturnsUnsuccessfulOperation()
        {
            // Arrange
            var commentsCount = _appDbContext.Comments.Count();
            var id            = 1;

            // Act
            var operationResult             = _commentManager.DeleteAsync(id).GetAwaiter().GetResult();
            var commentsCountAfterOperation = _appDbContext.Comments.Count();

            // Assert
            Assert.Equal(0, operationResult);
            Assert.Equal(commentsCount, commentsCountAfterOperation);
        }
Esempio n. 2
0
 public async Task Delete(EntityDto <Guid> input)
 {
     //TODO:删除前的逻辑判断,是否允许删除
     await _commentManager.DeleteAsync(input.Id);
 }