Exemplo n.º 1
0
        public async void Delete()
        {
            Mock <ILogger <PostHistoryTypeRepository> > loggerMoc = PostHistoryTypeRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = PostHistoryTypeRepositoryMoc.GetContext();
            var             repository   = new PostHistoryTypeRepository(loggerMoc.Object, context);
            PostHistoryType entity       = new PostHistoryType();

            context.Set <PostHistoryType>().Add(entity);
            await context.SaveChangesAsync();

            await repository.Delete(entity.Id);

            PostHistoryType modifiedRecord = await context.Set <PostHistoryType>().FirstOrDefaultAsync();

            modifiedRecord.Should().BeNull();
        }