public void Should_return_self_if_converted_to_itself() { var valueObject = IntBasedStructValueObject.Create(42); IntBasedStructValueObjectTypeConverter.ConvertTo(valueObject, typeof(IntBasedStructValueObject)).Should().Be(valueObject); }
public void Should_return_valid_instance_if_converted_to_nullable_type_of_itself() { IntBasedStructValueObject?valueObject = IntBasedStructValueObject.Create(42); IntBasedStructValueObjectTypeConverter.ConvertTo(valueObject, typeof(IntBasedStructValueObject?)).Should().Be(valueObject.Value); }
public void Should_return_key_if_value_type_is_struct_and_key_matches_the_struct_key() { IntBasedStructValueObjectTypeConverter.ConvertTo(IntBasedStructValueObject.Create(42), typeof(int)).Should().Be(42); }