예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @EnumSource(DescriptorFactory.class) void shouldLookupSingleKeyAndSharedCompositeKeyDescriptors(DescriptorFactory factory)
        internal virtual void ShouldLookupSingleKeyAndSharedCompositeKeyDescriptors(DescriptorFactory factory)
        {
            // given
            SchemaDescriptorLookupSet <SchemaDescriptor> set = new SchemaDescriptorLookupSet <SchemaDescriptor>();
            SchemaDescriptor expected1 = factory.descriptor(1, 2);
            SchemaDescriptor expected2 = factory.descriptor(1, 2, 3);

            set.Add(expected1);
            set.Add(expected2);

            // when
            ISet <SchemaDescriptor> descriptors = new HashSet <SchemaDescriptor>();

            set.MatchingDescriptorsForPartialListOfProperties(descriptors, Longs(1), Ints(2));

            // then
            assertEquals(asSet(expected1, expected2), descriptors);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @EnumSource(DescriptorFactory.class) void shouldLookupCompositeKeyDescriptor(DescriptorFactory factory)
        internal virtual void ShouldLookupCompositeKeyDescriptor(DescriptorFactory factory)
        {
            // given
            SchemaDescriptorLookupSet <SchemaDescriptor> set = new SchemaDescriptorLookupSet <SchemaDescriptor>();
            SchemaDescriptor descriptor1 = factory.descriptor(1, 2, 3);
            SchemaDescriptor descriptor2 = factory.descriptor(1, 2, 4);
            SchemaDescriptor descriptor3 = factory.descriptor(1, 2, 5, 6);

            set.Add(descriptor1);
            set.Add(descriptor2);
            set.Add(descriptor3);

            // when
            ISet <SchemaDescriptor> descriptors = new HashSet <SchemaDescriptor>();

            set.MatchingDescriptorsForCompleteListOfProperties(descriptors, Longs(1), Ints(2, 5, 6));

            // then
            assertEquals(asSet(descriptor3), descriptors);
        }
예제 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ParameterizedTest @EnumSource(DescriptorFactory.class) void shouldLookupAllByEntityToken(DescriptorFactory factory)
        internal virtual void ShouldLookupAllByEntityToken(DescriptorFactory factory)
        {
            // given
            SchemaDescriptorLookupSet <SchemaDescriptor> set = new SchemaDescriptorLookupSet <SchemaDescriptor>();
            SchemaDescriptor descriptor1 = factory.descriptor(1, 2, 3);
            SchemaDescriptor descriptor2 = factory.descriptor(1, 2, 4);
            SchemaDescriptor descriptor3 = factory.descriptor(1, 2, 5, 6);
            SchemaDescriptor descriptor4 = factory.descriptor(2, 2, 3);
            SchemaDescriptor descriptor5 = factory.descriptor(3, 2, 5, 6);

            set.Add(descriptor1);
            set.Add(descriptor2);
            set.Add(descriptor3);
            set.Add(descriptor4);
            set.Add(descriptor5);

            // when
            ISet <SchemaDescriptor> descriptors = new HashSet <SchemaDescriptor>();

            set.MatchingDescriptors(descriptors, Longs(1));

            // then
            assertEquals(asSet(descriptor1, descriptor2, descriptor3), descriptors);
        }