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