Пример #1
0
            public static void Comparable_Some_WithNone()
            {
                // Arrange
                var cmp = new AnyComparer();
                IStructuralComparable one = One;
                IStructuralComparable two = Two;

                // Act & Assert
                Assert.Equal(1, one.CompareTo(Ø, cmp));
                Assert.Equal(1, two.CompareTo(Ø, cmp));
            }
Пример #2
0
            public static void Comparable_Some_Throws_WithInvalidType()
            {
                // Arrange
                var cmp = new AnyComparer();
                IStructuralComparable one = One;

                // Act & Assert
                // NONGENERIC_MAYBE
                Assert.ThrowsArgexn("other", () => one.CompareTo(new object(), cmp));
                Assert.Equal(1, one.CompareTo(NoText, cmp));
                Assert.Throws <UnexpectedCallException>(() => one.CompareTo(SomeText, cmp));
            }
Пример #3
0
            public static void Comparable_None_Throws_WithInvalidType()
            {
                // Arrange
                var cmp = new AnyComparer();
                IStructuralComparable none = Ø;

                // Act & Assert
                // NONGENERIC_MAYBE
                Assert.ThrowsArgexn("other", () => none.CompareTo(new object(), cmp));
                Assert.Equal(0, none.CompareTo(NoText, cmp));
                Assert.Equal(-1, none.CompareTo(SomeText, cmp));
            }