示例#1
0
        public void AddBooleanOption_AddsNewTupleToOptionsProperty_WithCorrectValues()
        {
            var initialNumberOfOptions = _reportOptions.Options.Count;

            _reportOptions.AddBooleanOption("testOptionName", true);
            _reportOptions.AddBooleanOption("testOptionName2", false);

            Assert.AreEqual(0, initialNumberOfOptions);
            Assert.AreEqual(2, _reportOptions.Options.Count);
            Assert.AreEqual("testOptionName", _reportOptions.Options.First().Name);
            Assert.AreEqual("true", _reportOptions.Options.First().Value);
            Assert.IsNotNull(_reportOptions.Options.FirstOrDefault(t => t.Name == "testOptionName2"));
        }
示例#2
0
        public ReportRequestPropertiesContainer BrowseTreeReport(DateTime?startDate   = null,
                                                                 DateTime?endDate     = null,
                                                                 string marketplaceId = null,
                                                                 bool?rootNodesOnly   = null,
                                                                 string browseNodeId  = null)
        {
            var reportOptions = new ReportOptions();

            if (!string.IsNullOrWhiteSpace(marketplaceId))
            {
                reportOptions.AddStringOption("MarketplaceId", marketplaceId);
            }
            if (rootNodesOnly.HasValue)
            {
                reportOptions.AddBooleanOption("RootNodesOnly", rootNodesOnly.Value);
            }
            if (!string.IsNullOrWhiteSpace(browseNodeId))
            {
                reportOptions.AddStringOption("BrowseNodeId", browseNodeId);
            }
            if (!reportOptions.Options.Any())
            {
                reportOptions = null;
            }

            var reportContainer = ReportGeneratorHelper.GenerateReportRequest("_GET_XML_BROWSE_TREE_DATA_", ContentUpdateFrequency.Unknown,
                                                                              requestedMarketplaces: (List <string>)null, startDate: startDate, endDate: endDate, reportOptions: reportOptions);

            return(reportContainer);
        }
示例#3
0
        public ReportRequestPropertiesContainer FlatFileOrderReport(DateTime?startDate = null, DateTime?endDate = null,
                                                                    IEnumerable <MwsMarketplace> requestedMarketplacesGroup = null, bool showSalesChannel = false)
        {
            var reportOptions = new ReportOptions();

            reportOptions.AddBooleanOption("showSalesChannel", showSalesChannel);

            return(ReportGeneratorHelper.GenerateReportRequest("_GET_CONVERGED_FLAT_FILE_ORDER_REPORT_DATA_", ContentUpdateFrequency.Unknown,
                                                               requestedMarketplaces: requestedMarketplacesGroup,
                                                               reportOptions: reportOptions, startDate: startDate, endDate: endDate));
        }