예제 #1
0
        public void TestRetrieveAll()
        {
            ProductSQLDB        db        = new ProductSQLDB(dataSource);
            List <ProductProps> propsList = (List <ProductProps>)db.RetrieveAll(db.GetType());

            Assert.AreEqual(16, propsList.Count);
        }
예제 #2
0
        public void TestRetrieveAll()
        {
            ProductSQLDB db = new ProductSQLDB(dataSource);
            // create and fill list of ProductProps
            List <ProductProps> cProps = (List <ProductProps>)db.RetrieveAll(db.GetType());

            // cProps count should be equal to 16 (length of MMABooksUpdated Products table)
            Assert.AreEqual(16, cProps.Count);
        }
        public void TestCreate()
        {
            ProductSQLDB        db       = new ProductSQLDB(dataSource);
            ProductProps        p        = new ProductProps();
            List <ProductProps> propList = (List <ProductProps>)db.RetrieveAll(typeof(ProductProps));

            p.ID             = 800;
            p.description    = "Description";
            p.onhandquantity = 400;
            p.unitprice      = 515.25m;
            p.ConcurrencyID  = 1;

            Assert.AreEqual(16, propList.Count);

            ProductProps newProp = (ProductProps)db.Create(p);

            List <ProductProps> newList = (List <ProductProps>)db.RetrieveAll(typeof(ProductProps));

            Assert.AreEqual(17, newList.Count);
            Assert.AreEqual(52.50m, propList[9].unitprice);

            ProductProps anotherProp = (ProductProps)db.Create(newProp);
        }
예제 #4
0
 public void TestRetrieveAll()
 {
     list = (List <ProductProps>)db.RetrieveAll(props.GetType());
     Assert.AreEqual(list.Count, 16);
 }