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); }
public void TestGetPartFail() { SetUpDB(); PartMapper pm = new PartMapper(); Part p = pm.GetPart(4, conn); TearDown(); Assert.AreEqual(p, null); }
public void TestGetPartOK() { SetUpDB(); PartMapper pm = new PartMapper(); Part p = pm.GetPart(2, conn); TearDown(); Assert.AreEqual(p.partno, 2); }
public void TestDeletePartOK() { SetUpDB(); PartMapper pm = new PartMapper(); int rowsupdated = pm.DeletePart(2, conn); Part p = pm.GetPart(2, conn); TearDown(); Assert.AreEqual(rowsupdated, 1); Assert.AreEqual(p, null); }
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"); }
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); }