Serialize() public method

public Serialize ( ) : string
return string
        public void TestUpdateDiscount_OnlyRequired()
        {
            updateDiscount ud = new updateDiscount();

            ud.discountCode = "1";

            String actual   = ud.Serialize();
            String expected = @"
<discountCode>1</discountCode>";

            Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
Ejemplo n.º 2
0
        public void TestUpdateDiscount_OnlyRequired()
        {
            updateDiscount ud = new updateDiscount();

            ud.discountCode = "1";

            String actual   = ud.Serialize();
            String expected = @"
<discountCode>1</discountCode>";

            Assert.AreEqual(expected, actual);
        }
        public void TestUpdateDiscount_Full()
        {
            updateDiscount ud = new updateDiscount();

            ud.discountCode = "1";
            ud.name         = "cheaper";
            ud.amount       = 200;
            ud.startDate    = new DateTime(2013, 9, 5);
            ud.endDate      = new DateTime(2013, 9, 6);

            String actual   = ud.Serialize();
            String expected = @"
<discountCode>1</discountCode>
<name>cheaper</name>
<amount>200</amount>
<startDate>2013-09-05</startDate>
<endDate>2013-09-06</endDate>";

            Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
Ejemplo n.º 4
0
        public void TestUpdateDiscount_Full()
        {
            var ud = new updateDiscount();

            ud.discountCode = "1";
            ud.name         = "cheaper";
            ud.amount       = 200;
            ud.startDate    = new DateTime(2013, 9, 5);
            ud.endDate      = new DateTime(2013, 9, 6);

            var actual   = ud.Serialize();
            var expected = @"
<discountCode>1</discountCode>
<name>cheaper</name>
<amount>200</amount>
<startDate>2013-09-05</startDate>
<endDate>2013-09-06</endDate>";

            Assert.AreEqual(expected, actual);
        }
        public void TestUpdateDiscount_OnlyRequired()
        {
            updateDiscount ud = new updateDiscount();
            ud.discountCode = "1";

            String actual = ud.Serialize();
            String expected = @"
            <discountCode>1</discountCode>";
            Assert.AreEqual(expected, actual);
        }
        public void TestUpdateDiscount_Full()
        {
            updateDiscount ud = new updateDiscount();
            ud.discountCode = "1";
            ud.name = "cheaper";
            ud.amount = 200;
            ud.startDate = new DateTime(2013, 9, 5);
            ud.endDate = new DateTime(2013, 9, 6);

            String actual = ud.Serialize();
            String expected = @"
            <discountCode>1</discountCode>
            <name>cheaper</name>
            <amount>200</amount>
            <startDate>2013-09-05</startDate>
            <endDate>2013-09-06</endDate>";
            Assert.AreEqual(expected, actual);
        }