Esempio n. 1
0
 private void MapFrom_is_called(OutputClass destination)
 {
     _expected = new OutputClass
         {
             BooleanProperty = _source.BooleanProperty,
             IntegerProperty = _source.IntegerProperty,
             StringProperty = _source.StringProperty,
             DecimalProperty = _source.DecimalProperty,
             DateTimeProperty = _source.DateTimeProperty,
             DateTimeToNullable = _source.DateTimeToNullable
         };
     destination.MapFrom(_source);
 }
Esempio n. 2
0
            private void MapFrom_is_called_with_properties_to_ignore(OutputClass destination)
            {
                _expected = new OutputClass
                    {
                        BooleanProperty = _source.BooleanProperty,
                        IntegerProperty = _source.IntegerProperty,
                        StringProperty = _source.StringProperty,
                        DecimalProperty = 0,
                        DateTimeProperty = _source.DateTimeProperty,
                        DateTimeToNullable = _source.DateTimeToNullable
                    };

                destination.MapFrom(_source, x => x.DecimalProperty);
            }
Esempio n. 3
0
 private void MapTo_is_called_with_properties_to_ignore(InputClass source)
 {
     _destination = source.MapTo<OutputClass>(p => p.DecimalProperty);
     _expected = new OutputClass
         {
             BooleanProperty = source.BooleanProperty,
             IntegerProperty = source.IntegerProperty,
             StringProperty = source.StringProperty,
             DecimalProperty = 0,
             DateTimeProperty = source.DateTimeProperty,
             DateTimeToNullable = source.DateTimeToNullable
         };
 }
Esempio n. 4
0
 private void Ignore_the_property_values_that_were_set_ignore(OutputClass destination)
 {
     destination.DecimalProperty.ShouldNotBeEqualTo(_source.DecimalProperty);
 }
Esempio n. 5
0
 private void Map_the_property_values(OutputClass destination)
 {
     var tester = new MappingTester<OutputClass>();
     var result = tester.Verify(destination, _expected);
     result.IsValid.ShouldBeTrue();
     result.ToString().ShouldBeEqualTo("");
 }