コード例 #1
0
        public void TestSchema()
        {
            OperationOptionInfo opInfo =
                new OperationOptionInfo("name", typeof(int?));
            ObjectClassInfoBuilder bld = new ObjectClassInfoBuilder();

            bld.ObjectType = ObjectClass.ACCOUNT_NAME;
            ObjectClassInfo info = bld.Build();
            ICollection <ObjectClassInfo> temp = CollectionUtil.NewSet(info);
            IDictionary <SafeType <APIOperation>, ICollection <ObjectClassInfo> > map =
                new Dictionary <SafeType <APIOperation>, ICollection <ObjectClassInfo> >();

            map[SafeType <APIOperation> .Get <CreateApiOp>()] = temp;
            ICollection <OperationOptionInfo> temp2 = CollectionUtil.NewSet(opInfo);
            IDictionary <SafeType <APIOperation>, ICollection <OperationOptionInfo> > map2 =
                new Dictionary <SafeType <APIOperation>, ICollection <OperationOptionInfo> >();

            map2[SafeType <APIOperation> .Get <CreateApiOp>()] = temp2;
            Schema v1 = new Schema(CollectionUtil.NewSet(info),
                                   CollectionUtil.NewSet(opInfo),
                                   map,
                                   map2);
            Schema v2 = (Schema)CloneObject(v1);

            Assert.AreEqual(v1, v2);
            Assert.AreEqual(info, v2.ObjectClassInfo.First());
            Assert.AreEqual(1, v2.SupportedObjectClassesByOperation.Count);
            Assert.AreEqual(1, v2.SupportedOptionsByOperation.Count);
            Assert.AreEqual(1, v2.OperationOptionInfo.Count);
        }
コード例 #2
0
        public void testOperationOptionInfo()
        {
            OperationOptionInfo v1 =
                new OperationOptionInfo("name", typeof(int?));
            OperationOptionInfo v2 =
                (OperationOptionInfo)CloneObject(v1);

            Assert.AreEqual(v1, v2);
        }