/// <summary> /// Initializes a new instance of the <see cref="OutcomeMapping"/> class /// </summary> /// <param name="cacheItem">The cache item</param> internal OutcomeMapping(OutcomeMappingCacheItem cacheItem) { Guard.Argument(cacheItem, nameof(cacheItem)).NotNull(); OutcomeId = cacheItem.OutcomeId; ProducerOutcomeId = cacheItem.ProducerOutcomeId; _producerOutcomeNames = cacheItem.ProducerOutcomeNames; MarketId = cacheItem.MarketId; }
/// <summary> /// Initializes a new instance of the <see cref="OutcomeMapping" /> class /// </summary> /// <param name="cacheItem">The cache item</param> internal OutcomeMapping(OutcomeMappingCacheItem cacheItem) { Contract.Requires(cacheItem != null); OutcomeId = cacheItem.OutcomeId; ProducerOutcomeId = cacheItem.ProducerOutcomeId; _producerOutcomeNames = cacheItem.ProducerOutcomeNames; MarketId = cacheItem.MarketId; }
private static void ValidateMappingOutcome(mappingsMappingMapping_outcome msg, OutcomeMappingCacheItem ci) { Assert.AreEqual(msg.outcome_id, ci.OutcomeId); Assert.AreEqual(msg.product_outcome_id, ci.ProducerOutcomeId); Assert.IsNotNull(ci.ProducerOutcomeNames); Assert.AreEqual(2, ci.ProducerOutcomeNames.Count); Assert.AreEqual(msg.product_outcome_name, ci.ProducerOutcomeNames.First().Value); }