Exemple #1
0
        public ServiceResponse GetQuoteOptions(UserSessionModel user, long?projectId, long?currentQuoteId)
        {
            ServiceResponse responese    = new ServiceResponse();
            QuoteOptions    quoteOptions = new QuoteOptions();


            responese.Model = quoteOptions;
            return(responese);
        }
        public void ToXmlStringFileBasedTest()
        {
            var service = new Service() { ServiceID = 54 };

            var files = new List<File>() { new File() { AssetID = 123456 } };

            var targetLanguages = new List<String>() { "it-it", "fr-fr" };

            var quoteOptions = new QuoteOptions("en-gb", targetLanguages, "EUR") { ServiceID = service.ServiceID };

            var referenceFiles = new List<File>() { new File() { AssetID = 12345 }, new File() { AssetID = 12346 } };

            var generateQuote = new GenerateQuote(files, quoteOptions, referenceFiles);

            String xml = @"
                <GenerateQuote>
                    <TranslationOptions>
                        <Currency>EUR</Currency>
                        <ServiceID>54</ServiceID>
                        <SourceLanguage>
                            <LanguageCode>en-gb</LanguageCode>
                        </SourceLanguage>
                        <TargetLanguages>
                            <TargetLanguage>
                                <LanguageCode>it-it</LanguageCode>
                            </TargetLanguage>
                            <TargetLanguage>
                                <LanguageCode>fr-fr</LanguageCode>
                            </TargetLanguage>
                         </TargetLanguages>
                    </TranslationOptions>
                    <Files>
                        <File>
                            <AssetID>123456</AssetID>
                        </File>
                    </Files>
                    <ReferenceFiles>
                        <ReferenceFile>
                            <AssetID>12345</AssetID>
                        </ReferenceFile>
                        <ReferenceFile>
                            <AssetID>12346</AssetID>
                        </ReferenceFile>
                    </ReferenceFiles>
                </GenerateQuote>
            ";

            Assert.AreEqual(Regex.Replace(xml, @"\s", ""), generateQuote.ToXmlString());
        }
Exemple #3
0
        public void ToXmlStringFileBasedTest()
        {
            var service = new Service()
            {
                ServiceID = 54
            };

            var files = new List <File>()
            {
                new File()
                {
                    AssetID = 123456
                }
            };

            var targetLanguages = new List <String>()
            {
                "it-it", "fr-fr"
            };

            var quoteOptions = new QuoteOptions("en-gb", targetLanguages, "EUR")
            {
                ServiceID = service.ServiceID
            };

            var referenceFiles = new List <File>()
            {
                new File()
                {
                    AssetID = 12345
                }, new File()
                {
                    AssetID = 12346
                }
            };

            var generateQuote = new GenerateQuote(files, quoteOptions, referenceFiles);

            String xml = @"
                <GenerateQuote>
                    <TranslationOptions>
                        <Currency>EUR</Currency>
                        <ServiceID>54</ServiceID>
                        <SourceLanguage>
                            <LanguageCode>en-gb</LanguageCode>
                        </SourceLanguage>
                        <TargetLanguages>
                            <TargetLanguage>
                                <LanguageCode>it-it</LanguageCode>
                            </TargetLanguage>
                            <TargetLanguage>
                                <LanguageCode>fr-fr</LanguageCode>
                            </TargetLanguage>
                         </TargetLanguages>
                    </TranslationOptions>
                    <Files>
                        <File>
                            <AssetID>123456</AssetID>
                        </File>
                    </Files>
                    <ReferenceFiles>
                        <ReferenceFile>
                            <AssetID>12345</AssetID>
                        </ReferenceFile>
                        <ReferenceFile>
                            <AssetID>12346</AssetID>
                        </ReferenceFile>
                    </ReferenceFiles>
                </GenerateQuote>
            ";

            Assert.AreEqual(Regex.Replace(xml, @"\s", ""), generateQuote.ToXmlString());
        }
Exemple #4
0
        public void ToXmlStringProductBasedTest()
        {
            var service = new Service()
            {
                ServiceID = 54
            };

            var products = new List <Product>()
            {
                new Product(title: "The title of the item",
                            primaryCategory: 123,
                            topLevelCategory: 1,
                            categoryPath: "Clothing : Menswear : Shoes",
                            skus: new SKU[] { new SKU("1234", new Dictionary <string, string>()
                    {
                        { "Color", "White" }, { "Size", "Large" }
                    }) },
                            description: new ProductDescription(arbitraryElements: null,
                                                                features: new Dictionary <String, String>()
                {
                    { "Feature1", "Feature 1 & Bold" }, { "Feature2", "Feature 2" }
                },
                                                                summary: @"This is a summary it can contain HTML markup.
                                                                To tell the translation service to ignore some
                                                                text, <b>wrap</b> it in a
                                                                [do-not-translate]
                                                                do not translate
                                                                [/do-not-translate]
                                                                tag"))
            };

            var targetLanguages = new List <String>()
            {
                "it-it", "fr-fr"
            };

            var quoteOptions = new QuoteOptions("en-gb", targetLanguages, "EUR")
            {
                ServiceID = service.ServiceID
            };

            var referenceFiles = new List <File>()
            {
                new File()
                {
                    AssetID = 12345
                }, new File()
                {
                    AssetID = 12346
                }
            };

            var generateQuote = new GenerateQuote(products, quoteOptions, referenceFiles);

            String xml = @"
                <GenerateQuote>
                    <TranslationOptions>
                        <Currency>EUR</Currency>
                        <ServiceID>54</ServiceID>
                        <SourceLanguage>
                            <LanguageCode>en-gb</LanguageCode>
                        </SourceLanguage>
                        <TargetLanguages>
                            <TargetLanguage>
                                <LanguageCode>it-it</LanguageCode>
                            </TargetLanguage>
                                <TargetLanguage>
                                    <LanguageCode>fr-fr</LanguageCode>
                                </TargetLanguage>
                         </TargetLanguages>
                    </TranslationOptions>
                    <Products>
                        <Product>
                            <Title>The title of the item</Title>
                            <PrimaryCategory>123</PrimaryCategory>
                            <TopLevelCategory>1</TopLevelCategory>
                            <CategoryPath>Clothing : Menswear : Shoes</CategoryPath>
                            <Description>
                                <Summary>
                                    <![CDATA[
                                            This is a summary it can contain HTML markup.
                                            To tell the translation service to ignore some
                                            text, <b>wrap</b> it in a
                                            [do-not-translate]
                                            do not translate
                                            [/do-not-translate]
                                            tag
                                            ]]>

                                </Summary>
                                <Features>
                                    <Feature1>Feature 1 &amp; Bold</Feature1>
                                    <Feature2>Feature 2</Feature2>
                                </Features>
                            </Description>
                            <SKUs>
                                <SKU>
                                   <SKUNumber>1234</SKUNumber>
                                    <ItemSpecifics>
                                        <ItemSpecific>
                                            <Name>Color</Name>
                                            <Value>White</Value>
                                        </ItemSpecific>
                                        <ItemSpecific>
                                            <Name>Size</Name>
                                            <Value>Large</Value>
                                        </ItemSpecific>
                                  </ItemSpecifics>
                                </SKU>
                            </SKUs>
                        </Product>
                    </Products>
                    <ReferenceFiles>
                        <ReferenceFile>
                            <AssetID>12345</AssetID>
                        </ReferenceFile>
                        <ReferenceFile>
                            <AssetID>12346</AssetID>
                        </ReferenceFile>
                    </ReferenceFiles>
                </GenerateQuote>
            ";

            Assert.AreEqual(Regex.Replace(xml, @"\s", ""), Regex.Replace(generateQuote.ToXmlString(), @"\s", ""));
        }
Exemple #5
0
 public Quote GenerateQuote(Service service, Uri[] fileURLs, string[] fileNames, QuoteOptions options, IEnumerable <File> referenceFiles = null)
 {
     throw new NotImplementedException();
 }
Exemple #6
0
 public Quote GenerateQuote(Service service, string[] filePaths, QuoteOptions options, string[] referenceFilePaths = null)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
 public Quote GenerateQuote(Service service, IEnumerable <Product> products, QuoteOptions options, IEnumerable <File> referenceFiles = null)
 {
     throw new NotImplementedException();
 }
 public Quote GenerateQuote(Service service, Uri[] fileURLs, string[] fileNames, QuoteOptions options, IEnumerable<File> referenceFiles = null)
 {
     throw new NotImplementedException();
 }
 public Quote GenerateQuote(Service service, string[] filePaths, QuoteOptions options, string[] referenceFilePaths = null)
 {
     throw new NotImplementedException();
 }
 public Quote GenerateQuote(Service service, IEnumerable<Product> products, QuoteOptions options, IEnumerable<File> referenceFiles = null)
 {
     throw new NotImplementedException();
 }
        public void ToXmlStringProductBasedTest()
        {
            var service = new Service() { ServiceID = 54 };

            var products = new List<Product>() { new Product(title: "The title of the item",
                                                             primaryCategory: 123,
                                                             topLevelCategory: 1,
                                                             categoryPath: "Clothing : Menswear : Shoes",
                                                             skus: new SKU[] {new SKU("1234", new Dictionary<string,string>() {{"Color", "White"}, {"Size", "Large"}})},
                                                             description: new ProductDescription(arbitraryElements: null,
                                                                 features: new Dictionary<String, String>() { {"Feature1", "Feature 1 & Bold"}, {"Feature2", "Feature 2"} },
                                                             summary: @"This is a summary it can contain HTML markup.
                                                                To tell the translation service to ignore some
                                                                text, <b>wrap</b> it in a
                                                                [do-not-translate]
                                                                do not translate
                                                                [/do-not-translate]
                                                                tag"))};

            var targetLanguages = new List<String>() { "it-it", "fr-fr" };

            var quoteOptions = new QuoteOptions("en-gb", targetLanguages, "EUR") { ServiceID = service.ServiceID };

            var referenceFiles = new List<File>() { new File() { AssetID = 12345 }, new File() { AssetID = 12346 } };

            var generateQuote = new GenerateQuote(products, quoteOptions, referenceFiles);

            String xml = @"
                <GenerateQuote>
                    <TranslationOptions>
                        <Currency>EUR</Currency>
                        <ServiceID>54</ServiceID>
                        <SourceLanguage>
                            <LanguageCode>en-gb</LanguageCode>
                        </SourceLanguage>
                        <TargetLanguages>
                            <TargetLanguage>
                                <LanguageCode>it-it</LanguageCode>
                            </TargetLanguage>
                                <TargetLanguage>
                                    <LanguageCode>fr-fr</LanguageCode>
                                </TargetLanguage>
                         </TargetLanguages>
                    </TranslationOptions>
                    <Products>
                        <Product>
                            <Title>The title of the item</Title>
                            <PrimaryCategory>123</PrimaryCategory>
                            <TopLevelCategory>1</TopLevelCategory>
                            <CategoryPath>Clothing : Menswear : Shoes</CategoryPath>
                            <Description>
                                <Summary>
                                    <![CDATA[
                                            This is a summary it can contain HTML markup.
                                            To tell the translation service to ignore some
                                            text, <b>wrap</b> it in a
                                            [do-not-translate]
                                            do not translate
                                            [/do-not-translate]
                                            tag
                                            ]]>

                                </Summary>
                                <Features>
                                    <Feature1>Feature 1 &amp; Bold</Feature1>
                                    <Feature2>Feature 2</Feature2>
                                </Features>
                            </Description>
                            <SKUs>
                                <SKU>
                                   <SKUNumber>1234</SKUNumber>
                                    <ItemSpecifics>
                                        <ItemSpecific>
                                            <Name>Color</Name>
                                            <Value>White</Value>
                                        </ItemSpecific>
                                        <ItemSpecific>
                                            <Name>Size</Name>
                                            <Value>Large</Value>
                                        </ItemSpecific>
                                  </ItemSpecifics>
                                </SKU>
                            </SKUs>
                        </Product>
                    </Products>
                    <ReferenceFiles>
                        <ReferenceFile>
                            <AssetID>12345</AssetID>
                        </ReferenceFile>
                        <ReferenceFile>
                            <AssetID>12346</AssetID>
                        </ReferenceFile>
                    </ReferenceFiles>
                </GenerateQuote>
            ";

            Assert.AreEqual(Regex.Replace(xml, @"\s", ""), Regex.Replace(generateQuote.ToXmlString(), @"\s", ""));
        }