Ejemplo n.º 1
0
        public void GetDbSet_SomeEntity_EfCoreDbSetIsReturned()
        {
            var dbSet = _efCoreDbContext.GetDbSet <Person>();

            dbSet.Should().NotBeNull();
            dbSet.Should().BeOfType <EfCoreDbSet <Person> >();
        }
Ejemplo n.º 2
0
        public void Add_SomeEntity_EntityIsAdded()
        {
            _efCoreDbContext.GetDbSet <Person>().Add(new Person());

            _dbContext.Persons.Local.Should().HaveCount(1);
            _dbContext.Entry(_dbContext.Persons.Local.First()).State.Should().Be(EntityState.Added);
        }
        public async Task AnyAsync_EmptySet_FalseIsReturned()
        {
            var result = await _efCoreDbContext.GetDbSet <Person>().AsQueryable()
                         .AnyAsync();

            result.Should().BeFalse();
        }