Пример #1
0
 /// <summary>
 /// Called when the SecondaryFunction receives a new value, in order to update which
 /// of the outputs exist, and which labels they have.
 /// </summary>
 private void updateSecondaryOutputProperties(object sender = null,
                                              ValueChangedEventArgs evArgs = null)
 {
     if (new List <string> {
         "Min", "Max", "Sum", "Avg", "StdDev"
     }.
         Contains(mSecondaryFunction.Value))
     {
         // Add secondary value output; remove secondary index output
         mOutput2 = mTypeService.CreateDouble(PortTypes.Number,
                                              mSecondaryFunction.Value);
         mOutputIndex = null;
     }
     else if (new List <string> {
         "MinIndex", "MaxIndex"
     }.
              Contains(mSecondaryFunction.Value))
     {
         // Remove secondary value output; add secondary index output
         mOutput2     = null;
         mOutputIndex = mTypeService.CreateInt(PortTypes.Integer,
                                               mSecondaryFunction.Value);
     }
     else
     {
         // Remove both secondary outputs
         mOutput2     = null;
         mOutputIndex = null;
     }
 }
Пример #2
0
        public void ValueObject_GetHashCode()
        {
            var i1 = new IntValueObject {
                Prop = 123456798
            };

            i1.GetHashCode().Should().Be(123456798.GetHashCode());
        }
Пример #3
0
        public bool Equals(IntValueObject valueObject)
        {
            if (this.GetValue().Equals(valueObject.GetValue()))
            {
                return(true);
            }

            return(false);
        }
Пример #4
0
        public void ValueObject_Equals_NotEquals()
        {
            var i1 = new IntValueObject {
                Prop = 1
            };
            var i2 = new IntValueObject {
                Prop = 2
            };

            i1.Equals(i2).Should().BeFalse();
        }
Пример #5
0
        public void ValueObject_Equals_Equals()
        {
            var i1 = new IntValueObject {
                Prop = 1
            };
            var i2 = new IntValueObject {
                Prop = 1
            };

            object.ReferenceEquals(i1, i2).Should().BeFalse();
            i1.Equals(i2).Should().BeTrue();
        }
Пример #6
0
        public void ValueObject_Equals_NotSameType()
        {
            var i1 = new IntValueObject {
                Prop = 1
            };
            var s2 = new StringValueObject {
                Prop = "1"
            };

            object.ReferenceEquals(i1, s2).Should().BeFalse();
            i1.Equals(s2).Should().BeFalse();
        }
Пример #7
0
        public void ValueObject_InequalityOp_Equals()
        {
            var i1 = new IntValueObject {
                Prop = 1
            };
            var i2 = new IntValueObject {
                Prop = 1
            };

            ReferenceEquals(i1, i2).Should().BeFalse();
            (i1 != i2).Should().BeFalse();
        }
Пример #8
0
        public void ValueObject_InequalityOp_NotEquals()
        {
            var i1 = new IntValueObject {
                Prop = 1
            };
            var i2 = new IntValueObject {
                Prop = 2
            };

            (i1 != i2).Should().BeTrue();
            (i1 != null).Should().BeTrue();
            (null != i1).Should().BeTrue();
        }
Пример #9
0
        public void ValueObject_EqualityOp_NotEquals()
        {
            var i1 = new IntValueObject {
                Prop = 1
            };
            var i2 = new IntValueObject {
                Prop = 2
            };

            (i1 == i2).Should().BeFalse();
            (i1 == null).Should().BeFalse();
            ((IntValueObject)null == (IntValueObject)null).Should().BeTrue();
            (null == i1).Should().BeFalse();
        }