public async void Create() { Mock <ILogger <IncludedColumnTestRepository> > loggerMoc = IncludedColumnTestRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = IncludedColumnTestRepositoryMoc.GetContext(); var repository = new IncludedColumnTestRepository(loggerMoc.Object, context); var entity = new IncludedColumnTest(); await repository.Create(entity); var record = await context.Set <IncludedColumnTest>().FirstOrDefaultAsync(); record.Should().NotBeNull(); }
public async void Create() { Mock <ILogger <IncludedColumnTestRepository> > loggerMoc = IncludedColumnTestRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = IncludedColumnTestRepositoryMoc.GetContext(); var repository = new IncludedColumnTestRepository(loggerMoc.Object, context); var entity = new IncludedColumnTest(); entity.SetProperties(default(int), "B", "B"); await repository.Create(entity); var records = await context.Set <IncludedColumnTest>().ToListAsync(); records.Count.Should().Be(2); }