Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the Pet class.
 /// </summary>
 /// <param name="additionalProperties">Unmatched properties from the
 /// message are deserialized this collection</param>
 public Pet(IDictionary <string, Feature> additionalProperties = default(IDictionary <string, Feature>), string name = default(string), int?birthday = default(int?), WithStringDictionary wsd = default(WithStringDictionary), WithUntypedDictionary wud = default(WithUntypedDictionary), WithTypedDictionary wtd = default(WithTypedDictionary))
 {
     AdditionalProperties = additionalProperties;
     Name     = name;
     Birthday = birthday;
     Wsd      = wsd;
     Wud      = wud;
     Wtd      = wtd;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the Pet class.
 /// </summary>
 /// <param name="additionalProperties">Unmatched properties from the message are deserialized this collection</param>
 public Pet(IDictionary<string, Feature> additionalProperties = default(IDictionary<string, Feature>), string name = default(string), int? birthday = default(int?), WithStringDictionary wsd = default(WithStringDictionary), WithUntypedDictionary wud = default(WithUntypedDictionary), WithTypedDictionary wtd = default(WithTypedDictionary))
 {
     AdditionalProperties = additionalProperties;
     Name = name;
     Birthday = birthday;
     Wsd = wsd;
     Wud = wud;
     Wtd = wtd;
 }
        public void VerifyWithTypedDictionary()
        {
            // make sure it's constructable
            var withTypedDictionary = new WithTypedDictionary();
            Assert.NotNull(withTypedDictionary);

            // check to see if the JsonExtensionData attribute is on the member.
            var property = typeof(WithTypedDictionary).GetProperty("AdditionalProperties");
            Assert.NotNull(property);
            Assert.True(property.GetCustomAttributes().Any(each => each.GetType().Name == "JsonExtensionDataAttribute"));

            // check to see that the types of the AdditionalProperties object are correct
            var propertyType = property.PropertyType;
            Assert.Equal(new Type[] { typeof(string), typeof(Feature) }, propertyType.GenericTypeArguments);
        }