public void TheAttributeCanBeCreatedWithCustomMappingParameters_NoException() { ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{Start,FechaInicio}", "{End,FechaFin}" }); var expected = true; var actual = (attribute.PropertyMappingsDictionary != null) && (attribute.PropertyMappingsDictionary.Count == 2); Assert.IsTrue(expected == actual, message: "Calling the parametrized constructor should initialize the property mapping dictionary, parsing the string passed as parameter"); }
public void TheAttributeCanBeCreatedJustWithType_NoException() { ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange)); var expected = true; var actual = (attribute.PropertyMappingsDictionary != null) && (attribute.PropertyMappingsDictionary.Count == 0); Assert.IsTrue(expected == actual, message: "Calling the constructor with one parameter should initialize an empty property mapping dictionary"); }
public void IfTheAttributeTriesToInsertAPropertyNotExistantInValueObject_ArgumentException() { ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{StartDate,FechaInicio}", "{End,FechaInicio}" }); }
public void IfTheAttributeTriesToInsertSameFieldTwice_ArgumentException() { ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{Start,FechaInicio}", "{End,FechaInicio}" }); }
public void IfTheAttributeIsCreatedWithTooManyMappingParameters_ArgumentException() { ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{Start,FechaInicio,InicioFecha}", "{End,FechaFin}" }); }