public void ShouldMapAnInRangeWholeNumberDecimalToANullableInt() { var source = new PublicGetMethod <decimal>(53632.00m); var result = Mapper.Map(source).ToANew <PublicProperty <int?> >(); result.Value.ShouldBe((int)source.GetValue()); }
public void ShouldMapANullableGuidToAGuid() { var source = new PublicGetMethod <Guid?>(Guid.NewGuid()); var result = Mapper.Map(source).ToANew <PublicField <Guid> >(); result.Value.ShouldBe(source.GetValue().GetValueOrDefault()); }
public void ShouldMapOnToASetMethod() { var source = new PublicGetMethod <double>(5643723); var target = new PublicSetMethod <double>(); Mapper.Map(source).OnTo(target); target.Value.ShouldBe(source.GetValue()); }
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()); }