public void SignatureParameterWithSameNameAndValueShouldBeEqual()
        {
            BaseStringParameter parameter1 = new BaseStringParameter(NAME, VALUE);
            BaseStringParameter parameter2 = new BaseStringParameter(NAME, VALUE);

            BaseStringParameter parameter3 = new BaseStringParameter(NAME, "abc");
            BaseStringParameter parameter4 = new BaseStringParameter("abc", VALUE);

            Assert.That(parameter1, Is.EqualTo(parameter2));
            Assert.That(parameter2, Is.EqualTo(parameter1));

            Assert.That(parameter1, Is.Not.EqualTo(parameter3));
            Assert.That(parameter1, Is.Not.EqualTo(parameter4));
        }
        public void SignatureParameterWithSameNameAndValueShouldBeEqual()
        {
            BaseStringParameter parameter1 = new BaseStringParameter(NAME, VALUE);
            BaseStringParameter parameter2 = new BaseStringParameter(NAME, VALUE);

            BaseStringParameter parameter3 = new BaseStringParameter(NAME, "abc");
            BaseStringParameter parameter4 = new BaseStringParameter("abc", VALUE);

            Assert.That(parameter1, Is.EqualTo(parameter2));
            Assert.That(parameter2, Is.EqualTo(parameter1));

            Assert.That(parameter1, Is.Not.EqualTo(parameter3));
            Assert.That(parameter1, Is.Not.EqualTo(parameter4));
        }
 public void StringRepresentationShouldBeTheConcatenationOfNameAndValueUsingAnEqualsSign()
 {
     BaseStringParameter parameter = new BaseStringParameter(NAME, VALUE);
     Assert.That(parameter.ToString(), Is.EqualTo(NAME_VALUE_PAIR));
 }
        public void StringRepresentationShouldBeTheConcatenationOfNameAndValueUsingAnEqualsSign()
        {
            BaseStringParameter parameter = new BaseStringParameter(NAME, VALUE);

            Assert.That(parameter.ToString(), Is.EqualTo(NAME_VALUE_PAIR));
        }
Пример #5
0
        public override bool Equals(Object obj)
        {
            BaseStringParameter other = obj as BaseStringParameter;

            return(other != null && name == other.name && value == other.value);
        }