Simplifies the process of building 'AttributeInfo' objects.
This class is responsible for providing a default implementation of ConnectorAttributeInfo. AttributeInfoBuilder bld = new AttributeInfoBuilder("email"); bld.setRequired(true); AttributeInfo info = bld.build();
Ejemplo n.º 1
0
 public void TestObjectClassInfo()
 {
     ConnectorAttributeInfoBuilder builder = new ConnectorAttributeInfoBuilder();
     builder.Name = ("foo");
     builder.ValueType = (typeof(String));
     builder.Required = (true);
     builder.Readable = (true);
     builder.Updateable = (true);
     builder.MultiValued = (true);
     ObjectClassInfoBuilder obld = new ObjectClassInfoBuilder();
     obld.ObjectType = ObjectClass.ACCOUNT_NAME;
     obld.IsContainer = true;
     obld.AddAttributeInfo(builder.Build());
     ObjectClassInfo v1 = obld.Build();
     ObjectClassInfo v2 = (ObjectClassInfo)CloneObject(v1);
     Assert.AreEqual(v1, v2);
     Assert.IsTrue(v2.IsContainer);
 }
Ejemplo n.º 2
0
        public void TestAttributeInfo()
        {
            ConnectorAttributeInfoBuilder builder = new ConnectorAttributeInfoBuilder();
            builder.Name = ("foo");
            builder.ValueType = (typeof(String));
            builder.Required = (true);
            builder.Readable = (true);
            builder.Creatable = (true);
            builder.Updateable = (true);
            builder.MultiValued = (true);
            builder.ReturnedByDefault = false;
            ConnectorAttributeInfo v1 = builder.Build();
            ConnectorAttributeInfo v2 = (ConnectorAttributeInfo)CloneObject(v1);
            Assert.AreEqual(v1, v2);
            Assert.AreEqual("foo", v2.Name);
            Assert.AreEqual(typeof(String), v2.ValueType);
            Assert.IsTrue(v2.IsMultiValued);
            Assert.IsTrue(v2.IsReadable);
            Assert.IsTrue(v2.IsRequired);
            Assert.IsTrue(v2.IsUpdateable);
            Assert.IsTrue(v2.IsCreatable);
            Assert.IsFalse(v2.IsReturnedByDefault);

            builder.InfoFlags = AllFlags();
            v1 = builder.Build();
            v2 = (ConnectorAttributeInfo)CloneObject(v1);
            Assert.AreEqual(v1, v2);
        }