public void TestClone() { ProductProps props2 = (ProductProps)props1.Clone(); Assert.NotNull(props2); Assert.AreNotSame(props1, props2); }
public void TestClone() { ProductProps props2 = (ProductProps)props1.Clone(); Assert.NotNull(props2); props1.ProductCode = "zzzz"; Assert.AreNotEqual(props2.ProductCode, props1.ProductCode); Assert.AreNotSame(props2, props1); }
public void CloneTest() { ProductProps cloneProps = (ProductProps)props.Clone(); Assert.AreEqual(props.ID, cloneProps.ID); Assert.AreEqual(props.productCode, cloneProps.productCode); Assert.AreEqual(props.description, cloneProps.description); Assert.AreEqual(props.unitPrice, cloneProps.unitPrice); Assert.AreEqual(props.onHandQuantity, cloneProps.onHandQuantity); Assert.AreEqual(props.ConcurrencyID, cloneProps.ConcurrencyID); }
public void CloneTest() { ProductProps props2 = new ProductProps(); props2 = (ProductProps)props.Clone(); Assert.AreEqual(props.productID, props2.productID); Assert.AreEqual(props.productCode, props2.productCode); Assert.AreEqual(props.description, props2.description); Assert.AreEqual(props.unitPrice, props2.unitPrice); Assert.AreEqual(props.onHandQuantity, props2.onHandQuantity); Assert.AreEqual(props.ConcurrencyID, props2.ConcurrencyID); }
public void TestClone() { // must cast to CustomerProps because Clone() returns an object ProductProps props2 = (ProductProps)props1.Clone(); Assert.NotNull(props2); // change props1 description to Oceanic Languages" props1.description = "Oceanic Languages"; Assert.AreNotEqual(props1.description, props2.description); Assert.AreNotSame(props1, props2); }
public void TestClone() { ProductProps p2 = (ProductProps)p.Clone(); Assert.AreEqual(p.ID, p2.ID); Assert.AreEqual(p.code, p2.code); Assert.AreEqual(p.description, p2.description); Assert.AreEqual(p.price, p2.price); Assert.AreEqual(p.quantity, p2.quantity); Assert.AreEqual(p.ConcurrencyID, p2.ConcurrencyID); p.ID = 4; Assert.AreNotEqual(p.ID, p2.ID); }
//test the methods we wrote public void TestClone() { ProductProps clonedp = (ProductProps)testp.Clone(); //assert that areEqual all the properties Assert.AreEqual(testp.ID, clonedp.ID); Assert.AreEqual(testp.quantity, clonedp.quantity); Assert.AreEqual(testp.code, clonedp.code); Assert.AreEqual(testp.price, clonedp.price); Assert.AreEqual(testp.description, clonedp.description); Assert.AreEqual(testp.ConcurrencyID, clonedp.ConcurrencyID); testp.ID = 4; Assert.AreNotEqual(testp.ID, clonedp.ID); }
public void TestClone() { //ProductProps p = new ProductProps(); //p.ID = 10; //p.Code = "p000"; //p.Description = "This is a test"; //p.Quantity = 10; //p.ConcurrencyID = 1; ProductProps newP = (ProductProps)p.Clone(); Assert.AreEqual(p.ID, newP.ID); Assert.AreEqual(p.Code, newP.Code); Assert.AreEqual(p.Description, newP.Description); Assert.AreEqual(p.Quantity, newP.Quantity); Assert.AreEqual(p.ConcurrencyID, newP.ConcurrencyID); }
public void TestClone() { ProductProps newP = (ProductProps)p.Clone(); Assert.IsTrue(p.productCode == newP.productCode); }