public void RoundtripSerialize()
        {
            var original = ConstructorBasedImportDefinition.CreateDefinition(
                "A",
                TypeIdentity.CreateDefinition(typeof(char[])),
                ImportCardinality.ExactlyOne,
                CreationPolicy.NonShared,
                GetConstructorForString().GetParameters().First());
            var copy = AssertExtensions.RoundTripSerialize(original);

            Assert.AreEqual(original, copy);
        }
        public void Create()
        {
            var obj = ConstructorBasedImportDefinition.CreateDefinition(
                "A",
                TypeIdentity.CreateDefinition(typeof(char[])),
                ImportCardinality.ExactlyOne,
                CreationPolicy.NonShared,
                GetConstructorForString().GetParameters().First());
            var constructor = GetConstructorForString();
            var parameter   = constructor.GetParameters().First();

            Assert.AreEqual("A", obj.ContractName);
            Assert.AreEqual(TypeIdentity.CreateDefinition(typeof(char[])), obj.RequiredTypeIdentity);
            Assert.AreEqual(ImportCardinality.ExactlyOne, obj.Cardinality);
            Assert.IsFalse(obj.IsRecomposable);
            Assert.IsTrue(obj.IsPrerequisite);
            Assert.AreEqual(ConstructorDefinition.CreateDefinition(constructor), obj.Constructor);
            Assert.AreEqual(TypeIdentity.CreateDefinition(typeof(string)), obj.DeclaringType);
            Assert.AreEqual(ParameterDefinition.CreateDefinition(parameter), obj.Parameter);
        }