Exemplo n.º 1
0
        public void GetAllCustomersExpect5Instances()
        {
            //arrange
            IDatabase testDB = new EFDatabase();

            //Act
            int actual   = testDB.GetAllCustomer("").Count();
            int expected = 5;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void GetEstatesToListingCalculation()
        {
            //arrange
            IDatabase testDB = new EFDatabase();

            //Act
            int actual   = testDB.GetEstatesBasedOn_ZipCodeAndHousetype(7100, new HouseType(1).TypeId, 2000).Count();
            int expected = 1;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void GetCustomerExpectOneInstance()
        {
            //arrange
            IDatabase testDB = new EFDatabase();

            //Act
            string actual   = testDB.GetCustomer(1).Name;
            string expected = "Marc";

            //Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void GetOpenHousesByDate()
        {
            //Arrange
            IDatabase testDB      = new EFDatabase();
            DateTime  expectedDay = new DateTime(2020, 12, 17);

            //Act
            var actual   = testDB.GetOpenHouses(expectedDay).Count();
            var expected = 4;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 5
0
 public EFDataStore(EFDatabase <TDBContext> db,
                    IEFDataMapper <TKey, TModel, TEFClass> mapper,
                    IEFDataStoreValidator <TKey, TModel, TEFClass> validator = null)
 {
     if (db == null)
     {
         throw new ArgumentNullException(nameof(db));
     }
     if (mapper == null)
     {
         throw new ArgumentNullException(nameof(mapper));
     }
     DB        = db;
     Mapper    = mapper;
     Validator = validator;
 }
 public DbSet <HouseType> GetGridType()
 {
     db = new EFDatabase();
     return(db.GetTypes());
 }
 public DbSet <Broker> GetGridBrokers()
 {
     db = new EFDatabase();
     return(db.GetBrokers());
 }
 public List <Broker> GetListBrokers()
 {
     db = new EFDatabase();
     return(db.GetBrokers().ToList());
 }