Esempio n. 1
0
        public void TestUpdatePartFail()
        {
            SetUpDB();
            PartMapper pm = new PartMapper();
            Part       p  = pm.GetPart(2, conn);

            p.partno = 4;
            int rowsupdated = pm.UpdatePart(p, conn);

            TearDown();
            Assert.AreEqual(rowsupdated, 0);
        }
Esempio n. 2
0
        public void TestUpdatePartOK()
        {
            SetUpDB();
            PartMapper pm = new PartMapper();
            Part       p  = pm.GetPart(2, conn);

            p.price = 1000.50m;
            int  rowsupdated = pm.UpdatePart(p, conn);
            Part pnew        = pm.GetPart(2, conn);

            TearDown();
            Assert.AreEqual(rowsupdated, 1);
            Assert.AreEqual(pnew.price, 1000.50m);
        }