public void ConvertsHexToColor(string hexString, Color expectedColor)
        {
            var converter      = new HexToColorConverter();
            var convertedValue = converter.Convert(hexString, typeof(Color), null, CurrentCulture);

            Assert.IsType <Color>(convertedValue);
            Assert.Equal(expectedColor, convertedValue);
        }
Ejemplo n.º 2
0
        public void Convert_does_return_Color_correctly(
            string hex, Type targetType, object parameter, CultureInfo culture)
        {
            //Arrange
            var sut = new HexToColorConverter();

            //Act
            var convertedValue = (Color)sut.Convert(hex, targetType, parameter, culture);

            //Assert
            convertedValue.ToHex().Should().Be(hex);
        }
Ejemplo n.º 3
0
        public void HexNull()
        {
            var returnVal = converter.Convert(null, null, null, null);

            Assert.AreEqual(converter.DefaultColor, returnVal);
        }