Example #1
0
        public void TestProductTextDBDelete()
        {
            ProductTextDB db    = new ProductTextDB(folder);
            ProductProps  props = (ProductProps)db.Retrieve(1);

            db.Delete(props);
            Assert.Throws <Exception>(() => db.Retrieve(1));
        }
Example #2
0
        public void TestProductTextDBRetrieve()
        {
            ProductTextDB db    = new ProductTextDB(folder);
            ProductProps  props = (ProductProps)db.Retrieve(1);

            Assert.AreEqual("P100", props.code);
            Assert.AreEqual(10, props.onHandQuantity);
        }
Example #3
0
        public void TestProductTextDBCreate()
        {
            ProductTextDB db    = new ProductTextDB(folder);
            ProductProps  props = new ProductProps();

            props.code           = "P300";
            props.description    = "This is the description of the third product";
            props.onHandQuantity = 30;
            props.unitPrice      = 300M;
            ProductProps props2 = (ProductProps)db.Create(props);

            Console.WriteLine(props.id);
            Console.WriteLine(props2.id);
            Assert.AreEqual(props.id, props2.id);
            Assert.AreEqual(props.concurrencyID, props2.concurrencyID);
            props = (ProductProps)db.Retrieve(3);
            Assert.AreEqual("P300", props.code);
        }