Exemple #1
0
        public void Equals_FalseForDifferentTypes()
        {
            var x = new TestValue("Foo", 42);
            var y = new TestValue2("Foo", 42);

            x.Equals(y).Should().BeFalse();
        }
Exemple #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = _testString != null?_testString.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ TestValue1;
                hashCode = (hashCode * 397) ^ TestValue2.GetHashCode();
                return(hashCode);
            }
        }
Exemple #3
0
        public void ToString_FormatsComponents(string foo, int bar, string toString)
        {
            var x = new TestValue2(foo, bar);

            x.ToString().Should().Be(toString);
        }