Пример #1
0
        public void QualificationsToXmlTest()
        {
            Promotion target = new Promotion();
            ProductBvin q1 = new ProductBvin("abc123");
            target.AddQualification(q1);

            string expected = "<Qualifications>" + System.Environment.NewLine;

            expected += "  <Qualification>" + System.Environment.NewLine;
            expected += "    <Id>" + q1.Id.ToString() + "</Id>" + System.Environment.NewLine;
            expected += "    <TypeId>" + q1.TypeId + "</TypeId>" + System.Environment.NewLine;
            expected += "    <ProcessingCost>0</ProcessingCost>" + System.Environment.NewLine;
            expected += "    <Settings>" + System.Environment.NewLine;
            expected += "      <Setting>" + System.Environment.NewLine;
            expected += "        <Key>ProductIds</Key>" + System.Environment.NewLine;
            expected += "        <Value>abc123</Value>" + System.Environment.NewLine;
            expected += "      </Setting>" + System.Environment.NewLine;
            expected += "    </Settings>" + System.Environment.NewLine;
            expected += "  </Qualification>" + System.Environment.NewLine;

            expected += "</Qualifications>";

            string actual;
            actual = target.QualificationsToXml();
            Assert.AreEqual(expected, actual);
        }