public async void All() { Mock <ILogger <MachineRepository> > loggerMoc = MachineRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = MachineRepositoryMoc.GetContext(); var repository = new MachineRepository(loggerMoc.Object, context); var records = await repository.All(); records.Should().NotBeEmpty(); records.Count.Should().Be(1); }
public async void All() { Mock <ILogger <MachineRepository> > loggerMoc = MachineRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = MachineRepositoryMoc.GetContext(); var repository = new MachineRepository(loggerMoc.Object, context); Machine entity = new Machine(); context.Set <Machine>().Add(entity); await context.SaveChangesAsync(); var record = await repository.All(); record.Should().NotBeEmpty(); }