示例#1
0
        public void TestQuoteServices_GetQuoteQuotePackage()
        {
            QuoteItemsModel model = new QuoteItemsModel();

            model.QuoteId = _quoteId;

            this.Response = quoteService.GetQuoteQuotePackage(user, model);
            Assert.That(this.Response.HasError, Is.EqualTo(false));

            model = this.Response.Model as QuoteItemsModel;
            QuoteItemListModel quoteItemListModel = model.Items.FirstOrDefault();

            Assert.That(quoteItemListModel, Is.Not.EqualTo(null));

            //make sure it has the QuotePackage
            Assert.That(model.QuotePackage, Is.Not.EqualTo(null));
            if (model.QuotePackage.Count > 0)
            {
                Assert.That(model.QuotePackage.First().DocumentTypeId, Is.Not.EqualTo(null));
            }

            if (model.QuotePackageAttachedFiles.Count > 0)
            {
                Assert.That(model.QuotePackageAttachedFiles, Is.Not.EqualTo(null));
                Assert.That(model.QuotePackageAttachedFiles.First().FileName,
                            Is.EqualTo(model.QuotePackage.First().FileName));
                Assert.That(model.QuotePackageAttachedFiles.First().Type.ToLower(),
                            Is.EqualTo("quotepackageattachedfile"));
                Assert.That(model.QuotePackageAttachedFiles.First().Description, Is.Not.EqualTo(string.Empty));
            }
        }