Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void should_construct_schema_cache()
        public virtual void ShouldConstructSchemaCache()
        {
            // GIVEN
            ICollection <SchemaRule> rules = asList(_hans, _witch, _gretel, _robot);
            SchemaCache cache = new SchemaCache(new ConstraintSemantics(), rules, IndexProviderMap.EMPTY);

            // THEN
            assertEquals(asSet(_hans, _gretel), Iterables.asSet(cache.IndexDescriptors()));
            assertEquals(asSet(_witch, _robot), Iterables.asSet(cache.ConstraintRules()));
        }
Exemple #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void addSchemaRules()
        public virtual void AddSchemaRules()
        {
            // GIVEN
            SchemaCache cache = NewSchemaCache();

            // WHEN
            cache.AddSchemaRule(_hans);
            cache.AddSchemaRule(_gretel);
            cache.AddSchemaRule(_witch);
            cache.AddSchemaRule(_robot);

            // THEN
            assertEquals(asSet(_hans, _gretel), Iterables.asSet(cache.IndexDescriptors()));
            assertEquals(asSet(_witch, _robot), Iterables.asSet(cache.ConstraintRules()));
        }
Exemple #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void addRemoveIndexes()
        public virtual void AddRemoveIndexes()
        {
            ICollection <SchemaRule> rules = asList(_hans, _witch, _gretel, _robot);
            SchemaCache cache = new SchemaCache(new ConstraintSemantics(), rules, IndexProviderMap.EMPTY);

            StoreIndexDescriptor rule1 = NewIndexRule(10, 11, 12);
            StoreIndexDescriptor rule2 = NewIndexRule(13, 14, 15);

            cache.AddSchemaRule(rule1);
            cache.AddSchemaRule(rule2);

            cache.RemoveSchemaRule(_hans.Id);
            cache.RemoveSchemaRule(_witch.Id);

            assertEquals(asSet(_gretel, rule1, rule2), Iterables.asSet(cache.IndexDescriptors()));
            assertEquals(asSet(_robot), Iterables.asSet(cache.ConstraintRules()));
        }