Exemplo n.º 1
0
 public void Get_ReturnsNull_WhenPrimaryKeyDoesNotMatchRow()
 {
     using (var dbContext = new EntityDbContext())
     {
         var entity = dbContext.Get <User>(int.MaxValue);
         entity.ShouldBeNull();
     }
 }
Exemplo n.º 2
0
 public void Get_ThrowsArgumentNullException_WhenFirstKeyValueArgumentIsNull()
 {
     using (var dbContext = new EntityDbContext())
     {
         var exception = Assert.Throws <ArgumentNullException>(() => dbContext.Get <User>(null));
         exception.ShouldNotBeNull();
         exception.ParamName.ShouldEqual("firstKeyValue");
     }
 }
Exemplo n.º 3
0
        public void NoArgGet_ReturnsDataFromStore()
        {
            using (var dbContext = new EntityDbContext())
            {
                var entities = dbContext.Get <User>().Take(2).ToArray();

                entities.ShouldNotBeNull();
                entities.Length.ShouldBeInRange(0, 2);
            }
        }