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