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); }
/// <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);