public void ConstructorNoPaymentRequiredTest()
        {
            string xml = @"<?xml version='1.0' encoding='UTF-8'?>
                <QuoteAuthorization>
                    <Status>Authorized</Status>
                    <QuoteURL>https://www.quoteurl.com/url</QuoteURL>
                    <Projects>
                        <Project>
                            <ProjectID>123</ProjectID>
                            <ProjectURL>https://www.projecturl.com/url</ProjectURL>
                            <ProjectDueDate>2014-02-11T10:22:46Z</ProjectDueDate>
                            <Products>
                                <Product>
                                    <AssetID>999</AssetID>
                                    <SKUs>
                                        <SKU>
                                            <SKUNumber>123</SKUNumber>
                                        </SKU>
                                    </SKUs>
                                </Product>
                            </Products>
                        </Project>
                    </Projects>
                </QuoteAuthorization>
            ";

            XDocument document = XDocument.Parse(xml);

            var quoteAuthorization = new QuoteAuthorization(document.Element("QuoteAuthorization"), new MockContentAPI());

            Assert.AreEqual("Authorized", quoteAuthorization.Status);
            Assert.AreEqual("https://www.quoteurl.com/url", quoteAuthorization.QuoteURL);

            Assert.AreEqual(1, quoteAuthorization.Projects.Count());
        }
        public void ConstructorNoPaymentRequiredTest()
        {
            string xml = @"<?xml version='1.0' encoding='UTF-8'?>
                <QuoteAuthorization>
                    <Status>Authorized</Status>
                    <QuoteURL>https://www.quoteurl.com/url</QuoteURL>
                    <Projects>
                        <Project>
                            <ProjectID>123</ProjectID>
                            <ProjectURL>https://www.projecturl.com/url</ProjectURL>
                            <ProjectDueDate>2014-02-11T10:22:46Z</ProjectDueDate>
                            <Products>
                                <Product>
                                    <AssetID>999</AssetID>
                                    <SKUs>
                                        <SKU>
                                            <SKUNumber>123</SKUNumber>
                                        </SKU>
                                    </SKUs>
                                </Product>
                            </Products>
                        </Project>
                    </Projects>
                </QuoteAuthorization>
            ";

            XDocument document = XDocument.Parse(xml);

            var quoteAuthorization = new QuoteAuthorization(document.Element("QuoteAuthorization"), new MockContentAPI());

            Assert.AreEqual("Authorized", quoteAuthorization.Status);
            Assert.AreEqual("https://www.quoteurl.com/url", quoteAuthorization.QuoteURL);

            Assert.AreEqual(1, quoteAuthorization.Projects.Count());
        }
Пример #3
0
        public void AuthorizeNullQuoteTest()
        {
            ContentAPI client = ConstructServiceClient();

            Quote authorizeQuote = new Quote(0, DateTime.Now, 0, 0, "", 0m, 0m, 0m, null);
            QuoteAuthorization quoteAuthorization = client.AuthorizeQuote(authorizeQuote);

            Assert.IsNull(quoteAuthorization);
        }