public void TestSubscription_CanContainCreateDiscounts()
{
subscription subscription = new subscription();
subscription.planCode = "123abc";
createDiscount cd1 = new createDiscount();
cd1.discountCode = "1";
cd1.name = "cheaper";
cd1.amount = 200;
cd1.startDate = new DateTime(2013, 9, 5);
cd1.endDate = new DateTime(2013, 9, 6);
createDiscount cd2 = new createDiscount();
cd2.discountCode = "2";
cd2.name = "cheap";
cd2.amount = 100;
cd2.startDate = new DateTime(2013, 9, 3);
cd2.endDate = new DateTime(2013, 9, 4);
subscription.createDiscounts.Add(cd1);
subscription.createDiscounts.Add(cd2);
String actual = subscription.Serialize();
String expected = @"
<planCode>123abc</planCode>
<createDiscount>
<discountCode>1</discountCode>
<name>cheaper</name>
<amount>200</amount>
<startDate>2013-09-05</startDate>
<endDate>2013-09-06</endDate>
</createDiscount>
<createDiscount>
<discountCode>2</discountCode>
<name>cheap</name>
<amount>100</amount>
<startDate>2013-09-03</startDate>
<endDate>2013-09-04</endDate>
</createDiscount>";
Assert.AreEqual(expected, actual);
}