Example #1
0
        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");
        }
Example #2
0
        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");
        }
Example #3
0
 public void IfTheAttributeTriesToInsertAPropertyNotExistantInValueObject_ArgumentException()
 {
     ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{StartDate,FechaInicio}", "{End,FechaInicio}" });
 }
Example #4
0
 public void IfTheAttributeTriesToInsertSameFieldTwice_ArgumentException()
 {
     ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{Start,FechaInicio}", "{End,FechaInicio}" });
 }
Example #5
0
 public void IfTheAttributeIsCreatedWithTooManyMappingParameters_ArgumentException()
 {
     ValueObjectAttribute attribute = new ValueObjectAttribute(typeof(DateRange), propertyTuples: new string[] { "{Start,FechaInicio,InicioFecha}", "{End,FechaFin}" });
 }