public void Should_return_true_if_type_is_nullable_struct() { IntBasedTypeConverter.CanConvertTo(typeof(int?)).Should().BeTrue(); }
public void Should_return_true_if_type_doesnt_matches_the_key_but_there_is_default_conversion_of_key_from_string() { IntBasedTypeConverter.CanConvertFrom(typeof(string)).Should().BeTrue(); }
public void Should_throw_if_null_is_provided_and_type_is_valueobject() { IntBasedTypeConverter.Invoking(c => c.ConvertTo(null, null, null, typeof(int))) .Should().Throw <NotSupportedException>() .WithMessage("Int32 is a struct and cannot be converted to 'null'."); }
public void Should_return_true_if_type_doesnt_matches_the_key_but_there_is_default_conversion_of_key_to_string() { IntBasedTypeConverter.ConvertTo(null, null, IntegerEnum.Item1, typeof(string)).Should().Be("1"); }
public void Should_return_default_of_the_key_if_null_is_provided() { IntBasedTypeConverter.ConvertTo(null, null, null, typeof(TestEnum)).Should().BeNull(); }
public void Should_return_default_of_provided_destinationtype_if_null_is_provided_and_type_is_referencetype() { IntBasedTypeConverter.ConvertTo(null, null, null, typeof(string)).Should().BeNull(); }
public void Should_return_true_if_type_doesnt_matches_the_key_but_there_is_default_conversion_of_key_from_string() { IntBasedTypeConverter.ConvertFrom(null, null, "1").Should().Be(IntegerEnum.Item1); }