Esempio n. 1
0
 public void FixedTests()
 {
     Assert.AreEqual("FFFFFF", RgbToHex.Rgb(255, 255, 255));
     Assert.AreEqual("FFFFFF", RgbToHex.Rgb(255, 255, 300));
     Assert.AreEqual("000000", RgbToHex.Rgb(0, 0, 0));
     Assert.AreEqual("9400D3", RgbToHex.Rgb(148, 0, 211));
     Assert.AreEqual("9400D3", RgbToHex.Rgb(148, -20, 211), "Handle negative numbers.");
     Assert.AreEqual("90C3D4", RgbToHex.Rgb(144, 195, 212));
     Assert.AreEqual("D4350C", RgbToHex.Rgb(212, 53, 12), "Consider single hex digit numbers.");
 }
Esempio n. 2
0
 public void RGBShouldReturnCorrectHexadecimalValue(int red, int green, int blue, string expected)
 => Assert.Equal(expected, RgbToHex.Rgb(red, green, blue));