Ejemplo n.º 1
0
        public void ColourConverter_ConvertSupportedColour_Succeeds()
        {
            Color colour = Color.Blue;
            IConverter <string, Color> converter = new ColourConverter();
            string expectedCode = ColourMap.GetCodeFor(colour);

            string converted = converter.Convert(colour);

            Assert.AreEqual(expectedCode, converted);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Convert an <see cref="Color"/> to a <see cref="string"/>.
 /// </summary>
 /// <param name="toConvert">The <see cref="Color"/> to convert</param>
 /// <returns>The converted <see cref="Color"/></returns>
 public override string Convert(Color toConvert) => ColourMap.GetCodeFor(toConvert);