// PUBLIC METHODS ///////////////////////////////////////////////////
        #region Assert Methods
        public static void Equal(IAttributesInfo expected, IAttributesInfo actual)
        {
            if (expected == null)
            {
                Assert.Null(actual);
                return;
            }
            Assert.NotNull(actual);

            MemberInfoAssert.Equal(expected, actual);

            var expectedList = expected.Collection.SafeToList();
            var actualList   = actual.Collection.SafeToList();

            Assert.Equal(expectedList.Count, actualList.Count);

            var count = expectedList.Count;

            for (var i = 0; i < count; ++i)
            {
                var expectedItem = expectedList[i];
                var actualItem   = actualList[i];
                AttributeInfoAssert.Equal(expectedItem, actualItem);
            }
        }
Ejemplo n.º 2
0
        // PROTECTED CONSTRUCTORS ///////////////////////////////////////////
        #region Constructors
        protected ClrTypeInfo(Type clrType,
                              IAttributesInfo attributesInfo)
        {
            Contract.Requires(clrType != null);
            Contract.Requires(attributesInfo != null);

            // JSON Properties
            this.ClrType        = clrType;
            this.AttributesInfo = attributesInfo;

            // Non-JSON Properties
            this.ClrTypeName = clrType.Name;

            // Initialization
            this.InitializeClrObjectNewMethod();
        }
Ejemplo n.º 3
0
        // PUBLIC CONSTRUCTORS //////////////////////////////////////////////
        #region Constructors
        public ResourceType(Type clrResourceType,
                            IHypermediaInfo hypermediaInfo,
                            IResourceIdentityInfo resourceIdentityInfo,
                            IAttributesInfo attributesInfo,
                            IRelationshipsInfo relationshipsInfo,
                            ILinksInfo linksInfo,
                            IMetaInfo metaInfo)
            : base(clrResourceType, attributesInfo)
        {
            Contract.Requires(hypermediaInfo != null);
            Contract.Requires(resourceIdentityInfo != null);
            Contract.Requires(relationshipsInfo != null);
            Contract.Requires(linksInfo != null);

            // JSON Properties
            this.HypermediaInfo       = hypermediaInfo;
            this.ResourceIdentityInfo = resourceIdentityInfo;
            this.RelationshipsInfo    = relationshipsInfo;
            this.LinksInfo            = linksInfo;
            this.MetaInfo             = metaInfo;
        }
Ejemplo n.º 4
0
 // PUBLIC CONSTRUCTORS //////////////////////////////////////////////
 #region Constructors
 public ComplexType(Type clrComplexType,
                    IAttributesInfo attributesInfo)
     : base(clrComplexType, attributesInfo)
 {
     this.ExtensionDictionary = new ExtensionDictionary <IComplexType>(this);
 }
Ejemplo n.º 5
0
 // PUBLIC CONSTRUCTORS //////////////////////////////////////////////
 #region Constructors
 public ComplexType(Type clrComplexType,
                    IAttributesInfo attributesInfo)
     : base(clrComplexType, attributesInfo)
 {
 }