コード例 #1
0
        public async void Delete()
        {
            Mock <ILogger <ActionTemplateVersionRepository> > loggerMoc = ActionTemplateVersionRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = ActionTemplateVersionRepositoryMoc.GetContext();
            var repository = new ActionTemplateVersionRepository(loggerMoc.Object, context);
            ActionTemplateVersion entity = new ActionTemplateVersion();

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

            await repository.Delete(entity.Id);

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

            modifiedRecord.Should().BeNull();
        }