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