Esempio n. 1
0
        public void Inequality_Operator_Should_Return_True_For_Different_PointS()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(2, 1);

            (point1 != point2).Should().BeTrue();
        }
Esempio n. 2
0
        public void Inequality_Operator_Should_Return_False_For_Same_PointS()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(1, 2);

            (point1 != point2).Should().BeFalse();
        }
Esempio n. 3
0
        public void Equality_Operator_Should_Return_True_For_Same_PointS()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(1, 2);

            (point1 == point2).Should().BeTrue();
        }
Esempio n. 4
0
        public void Equality_Operator_Should_Return_False_For_Different_PointS()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(3, 4);

            (point1 == point2).Should().BeFalse();
        }
Esempio n. 5
0
        public void GetHashCode_Should_Return_Same_Hash_For_Same_PointS()
        {
            var hash1 = new PointS(1, 2).GetHashCode();
            var hash2 = new PointS(1, 2).GetHashCode();

            hash1.Should().Be(hash2);
        }
Esempio n. 6
0
        public void Equals_Should_Return_False_For_Different_PointS_As_Object()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(2, 3);

            point1.Equals((object)point2).Should().BeFalse();
        }
Esempio n. 7
0
        public void Equals_Should_Return_True_For_Same_PointS_As_Object()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(1, 2);

            point1.Equals((object)point2).Should().BeTrue();
        }
Esempio n. 8
0
        public void Equals_Should_Return_True_For_Same_PointS()
        {
            var point1 = new PointS(1, 2);
            var point2 = new PointS(1, 2);

            Equals(point1, point2).Should().BeTrue();
        }
Esempio n. 9
0
        public void Unary_Minus_Operator_Should_Throw_On_MinValue()
        {
            var point = new PointS(short.MinValue, short.MinValue);

            point
            .Invoking(a => (-a).Whatever())
            .ShouldThrow <ArgumentException>();
        }
Esempio n. 10
0
        public void Unary_Minus_Operator_Should_Return_Correct_PointS()
        {
            var a = new PointS(20, -20);

            var b = -a;

            b.Should().HaveComponents(-20, 20);
        }
Esempio n. 11
0
        public void Binary_Plus_Operator_Should_Return_Correct_PointS()
        {
            var a = new PointS(-20, 20);
            var b = new PointS(20, -20);

            var c = a + b;

            c.Should().HaveComponents(0, 0);
        }
Esempio n. 12
0
        public void MinComponents_Should_Return_Correct_PointS()
        {
            var a = new PointS(-20, 30);
            var b = new PointS(20, -40);

            var c = PointS.MinComponents(a, b);

            c.Should().HaveComponents(-20, -40);
        }
Esempio n. 13
0
        public void Equals_Should_Return_False_For_Null_Object()
        {
            var point1 = new PointS(1, 2);

            point1.Equals(null).Should().BeFalse();
        }