public IPactVerifier HonoursPactWith(string consumerName)
        {
            if (String.IsNullOrEmpty(consumerName))
            {
                throw new ArgumentException("Please supply a non null or empty consumerName");
            }

            if (!String.IsNullOrEmpty(ConsumerName) && !ConsumerName.Equals(consumerName))
            {
                throw new ArgumentException("Please supply the same consumerName that was defined when calling the ProviderStatesFor method");
            }

            ConsumerName = consumerName;

            return(this);
        }
        public IProviderStates ProviderStatesFor(string consumerName, Action setUp = null, Action tearDown = null)
        {
            if (String.IsNullOrEmpty(consumerName))
            {
                throw new ArgumentException("Please supply a non null or empty consumerName");
            }

            if (!String.IsNullOrEmpty(ConsumerName) && !ConsumerName.Equals(consumerName))
            {
                throw new ArgumentException("Please supply the same consumerName that was defined when calling the HonoursPactWith method");
            }

            ConsumerName   = consumerName;
            ProviderStates = new ProviderStates(setUp, tearDown);

            return(this);
        }
Exemple #3
0
        /// <summary>
        /// Returns true if OrderItem instances are equal
        /// </summary>
        /// <param name="input">Instance of OrderItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderItem input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Name == input.Name ||
                     Name != null &&
                     Name.Equals(input.Name)
                     ) &&
                 (
                     MerchantSuppliedId == input.MerchantSuppliedId ||
                     MerchantSuppliedId != null &&
                     MerchantSuppliedId.Equals(input.MerchantSuppliedId)
                 ) &&
                 (
                     Price == input.Price ||
                     Price != null &&
                     Price.Equals(input.Price)
                 ) &&
                 (
                     Quantity == input.Quantity ||
                     Quantity != null &&
                     Quantity.Equals(input.Quantity)
                 ) &&
                 (
                     Extras == input.Extras ||
                     Extras != null &&
                     Extras.SequenceEqual(input.Extras)
                 ) &&
                 (
                     ConsumerName == input.ConsumerName ||
                     ConsumerName != null &&
                     ConsumerName.Equals(input.ConsumerName)
                 ) &&
                 (
                     SpecialInstructions == input.SpecialInstructions ||
                     SpecialInstructions != null &&
                     SpecialInstructions.Equals(input.SpecialInstructions)
                 ));
        }