Example #1
0
        public void TestCreatePartFail()
        {
            SetUpDB();
            PartMapper pm          = new PartMapper();
            Part       p           = new Part(2, "PartD", 34.50m, 25);
            int        rowsupdated = pm.InsertPart(p, conn);

            TearDown();
            Assert.AreEqual(rowsupdated, 0);
        }
Example #2
0
        public void TestCreatePartOK()
        {
            SetUpDB();
            PartMapper pm          = new PartMapper();
            Part       p           = new Part(4, "PartD", 34.50m, 25);
            int        rowsupdated = pm.InsertPart(p, conn);
            Part       pnew        = pm.GetPart(4, conn);

            TearDown();
            Assert.AreEqual(rowsupdated, 1);
            Assert.AreEqual(pnew.partname, "PartD");
        }