public void TestUpdate()
        {
            ProductSQLDB db    = new ProductSQLDB(dataSource);
            ProductProps props = (ProductProps)db.Retrieve(13);

            props.description = "Description";
            bool ok = db.Update(props);

            Assert.AreEqual(true, ok);

            ProductProps propsUpdated = (ProductProps)db.Retrieve(13);

            Assert.AreEqual("Description", props.description);
        }
        public void TestUpdate()
        {
            ProductSQLDB db    = new ProductSQLDB(dataSource);
            ProductProps props = (ProductProps)db.Retrieve(14);

            props.unitPrice = 55.50M;
            bool ok = db.Update(props);

            ProductProps propsUpdated = (ProductProps)db.Retrieve(14);

            //14    SQ12    Murach's SQL Server 2012     57.50   2465

            Assert.AreEqual("SQ12", props.prodCode);
            Assert.AreEqual(55.50M, props.unitPrice);
        }
Example #3
0
        public void TestUpdate()
        {
            ProductSQLDB db    = new ProductSQLDB(dataSource);
            ProductProps props = (ProductProps)db.Retrieve(1);

            props.ProductCode    = "zzz       ";
            props.Description    = "zzz";
            props.UnitPrice      = 120.00m;
            props.OnHandQuantity = 1234;

            db.Update(props);

            ProductProps propsUpdated = (ProductProps)db.Retrieve(1);

            Assert.AreEqual("zzz       ", propsUpdated.ProductCode);
            Assert.AreEqual("zzz", propsUpdated.Description);
            Assert.AreEqual(120.00m, propsUpdated.UnitPrice);
            Assert.AreEqual(1234, propsUpdated.OnHandQuantity);
        }