コード例 #1
0
        private void TestEqualsHashcode(SpatialArgs args1, SpatialArgs args2, ObjGenerator generator)
        {
            Object first;

            try
            {
                first = generator.gen(args1);
            }
            catch (Exception e) when(e.IsUnsupportedOperationException())
            {
                return;
            }
            if (first == null)
            {
                return;                           //unsupported op?
            }
            Object second = generator.gen(args1); //should be the same

            assertEquals(first, second);
            assertEquals(first.GetHashCode(), second.GetHashCode());
            second = generator.gen(args2);//now should be different
            assertNotSame(args1, args2);
        }
コード例 #2
0
        private void TestEqualsHashcode(SpatialArgs args1, SpatialArgs args2, ObjGenerator generator)
        {
            Object first;

            try
            {
                first = generator.gen(args1);
            }
#pragma warning disable 168
            catch (NotSupportedException e)
#pragma warning restore 168
            {
                return;
            }
            if (first == null)
            {
                return;                           //unsupported op?
            }
            Object second = generator.gen(args1); //should be the same
            assertEquals(first, second);
            assertEquals(first.GetHashCode(), second.GetHashCode());
            second = generator.gen(args2);//now should be different
            assertNotSame(args1, args2);
        }