コード例 #1
0
        public void CannotConvertNotNullableTypeToNotNullableType()
        {
            var converterChooserMock = new Mock <ISettingsConverterChooser>();
            var converter            = new NullableConverter(converterChooserMock.Object);

            var canConvert = converter.CanConvert(typeof(object), typeof(int));

            Assert.IsFalse(canConvert);
        }
コード例 #2
0
        public void CanConvertNullableTypeToWhateverType()
        {
            var converterChooserMock = new Mock <ISettingsConverterChooser>();
            var converter            = new NullableConverter(converterChooserMock.Object);

            var canConvert = converter.CanConvert(typeof(double?), typeof(object));

            Assert.IsTrue(canConvert);
        }