public void ShouldMapAnInRangeWholeNumberDecimalToANullableInt()
        {
            var source = new PublicGetMethod <decimal>(53632.00m);
            var result = Mapper.Map(source).ToANew <PublicProperty <int?> >();

            result.Value.ShouldBe((int)source.GetValue());
        }
Esempio n. 2
0
        public void ShouldMapANullableGuidToAGuid()
        {
            var source = new PublicGetMethod <Guid?>(Guid.NewGuid());
            var result = Mapper.Map(source).ToANew <PublicField <Guid> >();

            result.Value.ShouldBe(source.GetValue().GetValueOrDefault());
        }
Esempio n. 3
0
        public void ShouldMapOnToASetMethod()
        {
            var source = new PublicGetMethod <double>(5643723);
            var target = new PublicSetMethod <double>();

            Mapper.Map(source).OnTo(target);

            target.Value.ShouldBe(source.GetValue());
        }
Esempio n. 4
0
        public void ShouldOverwriteADefaultSimpleTypePropertyValue()
        {
            var source = new PublicGetMethod <decimal>(6372.00m);
            var target = new PublicField <decimal?> {
                Value = null
            };

            Mapper.Map(source).OnTo(target);

            target.Value.ShouldBe(source.GetValue());
        }