public void TestUpdateAddOn_OnlyRequired()
        {
            updateAddOn uao = new updateAddOn();

            uao.addOnCode = "1";

            String actual   = uao.Serialize();
            String expected = @"
<addOnCode>1</addOnCode>";

            Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
Exemple #2
0
        public void TestUpdateAddOn_OnlyRequired()
        {
            updateAddOn uao = new updateAddOn();

            uao.addOnCode = "1";

            String actual   = uao.Serialize();
            String expected = @"
<addOnCode>1</addOnCode>";

            Assert.AreEqual(expected, actual);
        }
        public void testUpdateSubscription_CanContainUpdateAddOns()
        {
            updateAddOn uao1 = new updateAddOn();

            uao1.addOnCode = "1";
            uao1.name      = "addOn1";
            uao1.amount    = 100;
            uao1.startDate = new DateTime(2013, 9, 5);
            uao1.endDate   = new DateTime(2013, 9, 6);

            updateAddOn uao2 = new updateAddOn();

            uao2.addOnCode = "2";
            uao2.name      = "addOn2";
            uao2.amount    = 200;
            uao2.startDate = new DateTime(2013, 9, 4);
            uao2.endDate   = new DateTime(2013, 9, 5);

            updateSubscription update = new updateSubscription();

            update.subscriptionId = 1;
            update.updateAddOns.Add(uao1);
            update.updateAddOns.Add(uao2);

            String actual   = update.Serialize();
            String expected = @"
<updateSubscription>
<subscriptionId>1</subscriptionId>
<updateAddOn>
<addOnCode>1</addOnCode>
<name>addOn1</name>
<amount>100</amount>
<startDate>2013-09-05</startDate>
<endDate>2013-09-06</endDate>
</updateAddOn>
<updateAddOn>
<addOnCode>2</addOnCode>
<name>addOn2</name>
<amount>200</amount>
<startDate>2013-09-04</startDate>
<endDate>2013-09-05</endDate>
</updateAddOn>
</updateSubscription>";

            Assert.AreEqual(Regex.Replace(expected, @"\s+", String.Empty), Regex.Replace(actual, @"\s+", String.Empty));
        }
        public void TestUpdateAddOn_Full()
        {
            updateAddOn uao = new updateAddOn();

            uao.addOnCode = "1";
            uao.name      = "addOn1";
            uao.amount    = 100;
            uao.startDate = new DateTime(2013, 9, 5);
            uao.endDate   = new DateTime(2013, 9, 6);

            String actual   = uao.Serialize();
            String expected = @"
<addOnCode>1</addOnCode>
<name>addOn1</name>
<amount>100</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));
        }
Exemple #5
0
        public void TestUpdateAddOn_Full()
        {
            var uao = new updateAddOn();

            uao.addOnCode = "1";
            uao.name      = "addOn1";
            uao.amount    = 100;
            uao.startDate = new DateTime(2013, 9, 5);
            uao.endDate   = new DateTime(2013, 9, 6);

            var actual   = uao.Serialize();
            var expected = @"
<addOnCode>1</addOnCode>
<name>addOn1</name>
<amount>100</amount>
<startDate>2013-09-05</startDate>
<endDate>2013-09-06</endDate>";

            Assert.AreEqual(expected, actual);
        }
        public void testUpdateSubscription_CanContainUpdateAddOns()
        {
            updateAddOn uao1 = new updateAddOn();
            uao1.addOnCode = "1";
            uao1.name = "addOn1";
            uao1.amount = 100;
            uao1.startDate = new DateTime(2013, 9, 5);
            uao1.endDate = new DateTime(2013, 9, 6);

            updateAddOn uao2 = new updateAddOn();
            uao2.addOnCode = "2";
            uao2.name = "addOn2";
            uao2.amount = 200;
            uao2.startDate = new DateTime(2013, 9, 4);
            uao2.endDate = new DateTime(2013, 9, 5);

            updateSubscription update = new updateSubscription();
            update.subscriptionId = 1;
            update.updateAddOns.Add(uao1);
            update.updateAddOns.Add(uao2);

            String actual = update.Serialize();
            String expected = @"
            <updateSubscription>
            <subscriptionId>1</subscriptionId>
            <updateAddOn>
            <addOnCode>1</addOnCode>
            <name>addOn1</name>
            <amount>100</amount>
            <startDate>2013-09-05</startDate>
            <endDate>2013-09-06</endDate>
            </updateAddOn>
            <updateAddOn>
            <addOnCode>2</addOnCode>
            <name>addOn2</name>
            <amount>200</amount>
            <startDate>2013-09-04</startDate>
            <endDate>2013-09-05</endDate>
            </updateAddOn>
            </updateSubscription>";
            Assert.AreEqual(expected, actual);
        }
        public void TestUpdateAddOn_OnlyRequired()
        {
            updateAddOn uao = new updateAddOn();
            uao.addOnCode = "1";

            String actual = uao.Serialize();
            String expected = @"
            <addOnCode>1</addOnCode>";
            Assert.AreEqual(expected, actual);
        }
        public void TestUpdateAddOn_Full()
        {
            updateAddOn uao = new updateAddOn();
            uao.addOnCode = "1";
            uao.name = "addOn1";
            uao.amount = 100;
            uao.startDate = new DateTime(2013, 9, 5);
            uao.endDate = new DateTime(2013, 9, 6);

            String actual = uao.Serialize();
            String expected = @"
            <addOnCode>1</addOnCode>
            <name>addOn1</name>
            <amount>100</amount>
            <startDate>2013-09-05</startDate>
            <endDate>2013-09-06</endDate>";
            Assert.AreEqual(expected, actual);
        }