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

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

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

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

            var entity = new RowVersionCheck();

            entity.SetProperties(default(int), "B", Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"));
            await repository.Create(entity);

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

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