Example #1
0
 public SKUIndexViewItem(Model.SKU sku, Model.Vendor vendor, Model.PrivateKey privateKey, IEnumerable <Model.SkuFeature> skuFeatures)
     : base(sku)
 {
     VendorName     = vendor.Name;
     PrivateKeyName = privateKey.DisplayName;
     FeatureSummary = skuFeatures.ToSummary(x => x.Feature.FeatureName, 3, ", ");
 }
Example #2
0
 public LicenseIndexViewItem(Model.License license, Model.Customer owningCustomer, Model.SKU sku, IEnumerable <Model.DomainLicense> domains)
     : base(license)
 {
     OwningCustomerName = (owningCustomer != null) ? owningCustomer.Name : "Not owned";
     SKUName            = sku.SkuCode;
     DomainSummary      = domains.ToSummary(x => x.DomainName, 1, ", ");
 }
Example #3
0
 public LicenseIndexViewItem(Model.License license, Model.Customer owningCustomer, Model.SKU sku, IEnumerable<Model.DomainLicense> domains)
     : base(license)
 {
     OwningCustomerName = (owningCustomer != null) ? owningCustomer.Name : "Not owned";
     SKUName = sku.SkuCode;
     DomainSummary = domains.ToSummary(x=>x.DomainName, 1, ", ");
 }
Example #4
0
 public SKUIndexViewItem(Model.SKU sku, Model.Vendor vendor, Model.PrivateKey privateKey, IEnumerable<Model.SkuFeature> skuFeatures)
     : base(sku)
 {
     VendorName = vendor.Name;
     PrivateKeyName = privateKey.DisplayName;
     FeatureSummary = skuFeatures.ToSummary(x => x.Feature.FeatureName, 3, ", ");
 }
        /// <summary>
        /// Printing to Console, uses <see cref="ResultsToStringJob(List{JobNode})"/>
        /// </summary>
        /// <param name="collection">List of the Collected Job Nodes</param>
        public static void PrintResults(this IEnumerable <JobNode> collection, ScraperConfig config)
        {
            if (collection is null)
            {
                Console.WriteLine("Invalid Config Parameters");
                return;
            }

            Console.OutputEncoding = Encoding.UTF8;
            Console.WriteLine(collection.ToSummary(config));
        }
        public CustomerAppIndexViewItem(Model.CustomerApp customerApp, IEnumerable<Model.License> customerAppLicenses)
            : base(customerApp)
        {
            LicenseSummary = customerAppLicenses.ToSummary(x => x.Sku.SkuCode, 3, ", ");
            if (customerApp.CustomerAppKeys.Any())
                ActiveCustomerAppKey = customerApp.CustomerAppKeys.Last().AppKey;

            WebConfigExample = string.Format(example, ActiveCustomerAppKey);

            IssueCount = customerApp.CustomerAppIssues.Count;
        }
        public TransactionIndexViewItem(Model.Transaction transaction, IEnumerable<Model.TransactionItem> transactionItems)
            : base(transaction)
        {
            PurchaserName = (transactionItems.FirstOrDefault().License != null) ?
                transactionItems.FirstOrDefault().License.PurchasingCustomer.Name : transaction.PurchaserName;

            SKUSummary =  transactionItems.ToSummary(x => (x.Sku != null) ? x.Sku.SkuCode : "None", 3, ", ");

            StatusName = transaction.Status.GetDescription<TransactionStatus>();

            IsWaitingForClaim = transaction.IsWaitingForClaim;
        }
        public TransactionIndexViewItem(Model.Transaction transaction, IEnumerable <Model.TransactionItem> transactionItems)
            : base(transaction)
        {
            PurchaserName = (transactionItems.FirstOrDefault().License != null) ?
                            transactionItems.FirstOrDefault().License.PurchasingCustomer.Name : transaction.PurchaserName;

            SKUSummary = transactionItems.ToSummary(x => (x.Sku != null) ? x.Sku.SkuCode : "None", 3, ", ");

            StatusName = transaction.Status.GetDescription <TransactionStatus>();

            IsWaitingForClaim = transaction.IsWaitingForClaim;
        }
        public CustomerAppIndexViewItem(Model.CustomerApp customerApp, IEnumerable <Model.License> customerAppLicenses)
            : base(customerApp)
        {
            LicenseSummary = customerAppLicenses.ToSummary(x => x.Sku.SkuCode, 3, ", ");
            if (customerApp.CustomerAppKeys.Any())
            {
                ActiveCustomerAppKey = customerApp.CustomerAppKeys.Last().AppKey;
            }

            WebConfigExample = string.Format(example, ActiveCustomerAppKey);

            IssueCount = customerApp.CustomerAppIssues.Count;
        }
Example #10
0
        public void ObserveInstrumentPrices(IEnumerable <InstrumentPrice> prices, IEnumerable <InstrumentPrice> expectedPrices, CachingInstrumentPriceService service)
        {
            var result = new List <InstrumentPrice>();

            ("Given the prices " + prices.ToSummary())
            .f(() => { });

            "And the service"
            .f(() => service = new CachingInstrumentPriceService(prices.ToObservable(), ImmediateScheduler.Instance, 1));

            "When ObserveInstrumentPrices() is called"
            .f(() => service.ObserveInstrumentPrices().Subscribe(p => result.Add(p)));

            ("Then the received prices are " + expectedPrices.ToSummary())
            .f(() => Assert.Equal(expectedPrices, result));
        }