public void CorrectlySetsValueWithTwoConstructorArguments()
            {
                var viewModelToModelAttribute = new ViewModelToModelAttribute("model", "property");

                Assert.AreEqual("model", viewModelToModelAttribute.Model);
                Assert.AreEqual("property", viewModelToModelAttribute.Property);
            }
            public void CorrectlySetsValueWithOneConstructorArgument()
            {
                var viewModelToModelAttribute = new ViewModelToModelAttribute("model");

                Assert.AreEqual("model", viewModelToModelAttribute.Model);
                Assert.AreEqual(string.Empty, viewModelToModelAttribute.Property);
            }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewModelToModelMapping"/> class.
 /// </summary>
 /// <param name="viewModelProperty">The view model property.</param>
 /// <param name="attribute">The <see cref="ViewModelToModelAttribute"/> that was used to define the mapping.</param>
 /// <exception cref="ArgumentException">The <paramref name="viewModelProperty"/> is <c>null</c> or whitespace.</exception>
 public ViewModelToModelMapping(string viewModelProperty, ViewModelToModelAttribute attribute)
     : this(viewModelProperty, attribute.Model, attribute.Property, attribute.Mode, attribute.ConverterType, attribute.AdditionalConstructorArgs, attribute.AdditionalPropertiesToWatch)
 {
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewModelToModelMapping"/> class.
 /// </summary>
 /// <param name="viewModelProperty">The view model property.</param>
 /// <param name="attribute">The <see cref="ViewModelToModelAttribute"/> that was used to define the mapping.</param>
 /// <exception cref="ArgumentException">The <paramref name="viewModelProperty"/> is <c>null</c> or whitespace.</exception>
 public ViewModelToModelMapping(string viewModelProperty, ViewModelToModelAttribute attribute)
     : this(viewModelProperty, attribute.Model, attribute.Property, attribute.Mode)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewModelToModelMapping"/> class.
 /// </summary>
 /// <param name="viewModelProperty">The view model property.</param>
 /// <param name="attribute">The <see cref="ViewModelToModelAttribute"/> that was used to define the mapping.</param>
 /// <exception cref="ArgumentException">The <paramref name="viewModelProperty"/> is <c>null</c> or whitespace.</exception>
 public ViewModelToModelMapping(string viewModelProperty, ViewModelToModelAttribute attribute)
     : this(viewModelProperty, attribute.Model, attribute.Property, attribute.Mode, attribute.ConverterType, attribute.AdditionalConstructorArgs, attribute.AdditionalPropertiesToWatch)
 {
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewModelToModelMapping"/> class.
 /// </summary>
 /// <param name="viewModelPropertyInfo">The view model property info.</param>
 /// <param name="modelPropertyType">The model property type.</param>
 /// <param name="attribute">The <see cref="ViewModelToModelAttribute"/> that was used to define the mapping.</param>
 /// <exception cref="ArgumentException">The <paramref name="viewModelPropertyInfo"/> is <c>null</c> or whitespace.</exception>
 public ViewModelToModelMapping(PropertyInfo viewModelPropertyInfo, Type modelPropertyType, ViewModelToModelAttribute attribute)
     : this(viewModelPropertyInfo.Name, viewModelPropertyInfo.PropertyType, modelPropertyType, attribute)
 {
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewModelToModelMapping"/> class.
 /// </summary>
 /// <param name="viewModelProperty">The view model property.</param>
 /// <param name="attribute">The <see cref="ViewModelToModelAttribute"/> that was used to define the mapping.</param>
 /// <exception cref="ArgumentException">The <paramref name="viewModelProperty"/> is <c>null</c> or whitespace.</exception>
 public ViewModelToModelMapping(string viewModelProperty, ViewModelToModelAttribute attribute)
     : this(viewModelProperty, attribute.Model, attribute.Property, attribute.Mode)
 {
 }