Example #1
0
 public TestProperty(TestPropertyType type, string groupName, string key, string value)
 {
     _key      = key;
     _value    = value;
     GroupName = groupName;
     Type      = type;
 }
Example #2
0
        public TestProperty(Attribute attribute, string groupName)
        {
            _attribute = attribute;

            GroupName = groupName;
            _key      = _attribute.Values[0];
            _value    = _attribute.Values[1];
            Type      = _attribute.Type == AttributeType.Class ? TestPropertyType.Class : TestPropertyType.Method;
        }
    public TestSource2()
    {
        LastAttributeIndex = -1;

        var prop1 = new TestPropertyType("prop1", true);
        var type  = new TestRootContentType(this);
        var type1 = type.CreateType("type1", prop1);

        const string xml = "<data><item1>poo</item1><item2 xx=\"33\" /><item2 xx=\"34\" /></data>";

        Content[1] = new TestContent(type1, 1, 1).WithValues(xml);

        Root = new TestRootContent(type).WithChildren(1);
    }
    public TestSource4()
    {
        LastAttributeIndex = -1;

        var prop1 = new TestPropertyType("prop1", true);
        var prop2 = new TestPropertyType("prop2");
        var type  = new TestRootContentType(this);
        var type1 = type.CreateType("type1", prop1, prop2);

        Content[1] = new TestContent(type1, 1, -1).WithValues("<data value=\"value\"/>", "dang");
        Content[2] = new TestContent(type1, 2, -1).WithValues(null, string.Empty);
        Content[3] = new TestContent(type1, 3, -1).WithValues(null, null);

        Root = new TestRootContent(type).WithChildren(1, 2, 3);
    }
    public TestSource3()
    {
        LastAttributeIndex = 1;

        var prop1 = new TestPropertyType("prop1");
        var prop2 = new TestPropertyType("prop2");
        var prop3 = new TestPropertyType("prop3");
        var type  = new TestRootContentType(this, prop1, prop2);
        var type1 = type.CreateType("type1", prop3);

        Content[1] = new TestContent(type1, 1, 1).WithValues("1:p1", "1:p2", "1:p3").WithChildren(2);
        Content[2] = new TestContent(type1, 2, 1).WithValues("2:p1", "2:p2", "2:p3");

        Root = new TestRootContent(type).WithChildren(1);
    }
    public TestSource8()
    {
        LastAttributeIndex = 0;

        var attr  = new TestPropertyType("attr");
        var prop  = new TestPropertyType("prop");
        var type  = new TestRootContentType(this, attr);
        var type1 = type.CreateType("item", attr, prop);

        Content[1] = new TestContent(type1, 1, -1).WithValues(null, null);
        Content[2] = new TestContent(type1, 2, -1).WithValues(string.Empty, string.Empty);
        Content[3] = new TestContent(type1, 3, -1).WithValues("   ", "   ");
        Content[4] = new TestContent(type1, 4, -1).WithValues(string.Empty, "\n");
        Content[5] = new TestContent(type1, 5, -1).WithValues("  ooo  ", "   ooo   ");
        Root       = new TestRootContent(type).WithValues(null).WithChildren(1, 2, 3, 4, 5);
    }
    public TestSource1()
    {
        // last attribute index is 1 -  meaning properties 0 and 1 are attributes, 2+ are elements
        // then, fieldValues must have adequate number of items
        LastAttributeIndex = 1;

        var prop1 = new TestPropertyType("prop1");
        var prop2 = new TestPropertyType("prop2");
        var prop3 = new TestPropertyType("prop3");
        var type  = new TestRootContentType(this, prop1, prop2);
        var type1 = type.CreateType("type1", prop3);

        Content[1] = new TestContent(type1, 1, -1).WithValues("1:p1", "1:p2", "1:p3");

        Root = new TestRootContent(type).WithValues(string.Empty, string.Empty).WithChildren(1);
    }
    public TestSource5()
    {
        LastAttributeIndex = -1;

        var prop1 = new TestPropertyType("prop1");
        var prop2 = new TestPropertyType("prop2");
        var type  = new TestRootContentType(this);
        var type1 = type.CreateType("type1", prop1, prop2);

        Content[1] = new TestContent(type1, 1, -1).WithValues("p11", "p12").WithChildren(3, 5);
        Content[2] = new TestContent(type1, 2, -1).WithValues("p21", "p22").WithChildren(4, 6);
        Content[3] = new TestContent(type1, 3, 1).WithValues("p31", "p32");
        Content[4] = new TestContent(type1, 4, 2).WithValues("p41", "p42");
        Content[5] = new TestContent(type1, 5, 1).WithValues("p51", "p52");
        Content[6] = new TestContent(type1, 6, 2).WithValues("p61", "p62");

        Root = new TestRootContent(type).WithChildren(1, 2);
    }
    public TestSource7()
    {
        LastAttributeIndex = 0;

        var prop1 = new TestPropertyType("isDoc");
        var prop2 = new TestPropertyType("title");
        var type  = new TestRootContentType(this, prop1);
        var type1 = type.CreateType("node", prop1, prop2);

        Content[1] = new TestContent(type1, 1, -1).WithValues(1, "title-1").WithChildren(3, 5);
        Content[2] = new TestContent(type1, 2, -1).WithValues(1, "title-2").WithChildren(4, 6);
        Content[3] = new TestContent(type1, 3, 1).WithValues(1, "title-3").WithChildren(7, 8);
        Content[4] = new TestContent(type1, 4, 2).WithValues(1, "title-4");
        Content[5] = new TestContent(type1, 5, 1).WithValues(1, "title-5");
        Content[6] = new TestContent(type1, 6, 2).WithValues(1, "title-6");

        Content[7] = new TestContent(type1, 7, 3).WithValues(1, "title-7");
        Content[8] = new TestContent(type1, 8, 3).WithValues(1, "title-8");

        Root = new TestRootContent(type).WithValues(null).WithChildren(1, 2);
    }