Esempio n. 1
0
 public void ReturnsNullWhenTableContainsEntity()
 {
     using (var dbContext = new TestDbContextContainer())
     {
         using (var repository = new DbContextCustomerRepository(dbContext))
         {
             var customer = repository.SingleOrDefault(x => x.Id == 999);
             Assert.IsNull(customer);
         }
     }
 }
Esempio n. 2
0
            public void ReturnsEntityWhenTableContainsEntity()
            {
                using (var dbContext = new TestDbContextContainer())
                {
                    using (var repository = new DbContextCustomerRepository(dbContext))
                    {
                        EFTestHelper.CreateCustomerIfNotAlreadyExists(1);

                        var customer = repository.SingleOrDefault(x => x.Id == 1);

                        Assert.IsNotNull(customer);
                        Assert.AreEqual(1, customer.Id);
                    }
                }
            }
 public void ReturnsNullWhenTableContainsEntity()
 {
     using (var dbContext = new TestDbContextContainer())
     {
         using (var repository = new DbContextCustomerRepository(dbContext))
         {
             var customer = repository.SingleOrDefault(x => x.Id == 999);
             Assert.IsNull(customer);
         }
     }
 }
            public void ReturnsEntityWhenTableContainsEntity()
            {
                using (var dbContext = new TestDbContextContainer())
                {
                    using (var repository = new DbContextCustomerRepository(dbContext))
                    {
                        EFTestHelper.CreateCustomerIfNotAlreadyExists(1);

                        var customer = repository.SingleOrDefault(x => x.Id == 1);

                        Assert.IsNotNull(customer);
                        Assert.AreEqual(1, customer.Id);
                    }
                }
            }