예제 #1
0
        public async void Create()
        {
            Mock <ILogger <OtherTransportRepository> > loggerMoc = OtherTransportRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = OtherTransportRepositoryMoc.GetContext();
            var repository = new OtherTransportRepository(loggerMoc.Object, context);

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

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

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

            var entity = new OtherTransport();

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

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

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