public async void Create()
        {
            Mock <ILogger <BreedRepository> > loggerMoc = BreedRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = BreedRepositoryMoc.GetContext();
            var repository = new BreedRepository(loggerMoc.Object, context);

            var entity = new Breed();
            await repository.Create(entity);

            var record = await context.Set <Breed>().FirstOrDefaultAsync();

            record.Should().NotBeNull();
        }
Example #2
0
        public async void Create()
        {
            Mock <ILogger <BreedRepository> > loggerMoc = BreedRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = BreedRepositoryMoc.GetContext();
            var repository = new BreedRepository(loggerMoc.Object, context);

            var entity = new Breed();

            entity.SetProperties(default(int), "B", 1);
            await repository.Create(entity);

            var records = await context.Set <Breed>().ToListAsync();

            records.Count.Should().Be(2);
        }