Example #1
0
        public async void All()
        {
            Mock <ILogger <BreedRepository> > loggerMoc = BreedRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = BreedRepositoryMoc.GetContext();
            var repository = new BreedRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
        public async void All()
        {
            Mock <ILogger <BreedRepository> > loggerMoc = BreedRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = BreedRepositoryMoc.GetContext();
            var repository = new BreedRepository(loggerMoc.Object, context);

            Breed entity = new Breed();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }