Пример #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;
 }
Пример #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;
 }
Пример #3
0
        public void VerifyWithStringDictionary()
        {
            // make sure it's constructable
            var withStringDictionary = new WithStringDictionary();
            Assert.NotNull(withStringDictionary);

            // check to see if the JsonExtensionData attribute is on the member.
            var property = typeof(WithStringDictionary).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(string) }, propertyType.GenericTypeArguments);
        }