public void NullPalette_ReturnsNull() { var testClass = new KMeansColourMatcher(); var rgbPixels = GetTestPixels(Color.Red, 1000); var testResult = testClass.GetClosestMatch(rgbPixels, null); Assert.IsNull(testResult); }
public void NullPixels_ReturnsNull() { var testClass = new KMeansColourMatcher(); var palette = GetTestPaletteOptions(Color.Black, Color.Blue, Color.Green); var testResult = testClass.GetClosestMatch(null, palette); Assert.IsNull(testResult); }
public void SolidColour_NoMatch() { var testClass = new KMeansColourMatcher(); var rgbPixels = GetTestPixels(Color.Red, 1000); var palette = GetTestPaletteOptions(Color.Black, Color.Blue, Color.Green); var testResult = testClass.GetClosestMatch(rgbPixels, palette); Assert.IsNull(testResult); }
public void EmptyPalette_ReturnsNull() { var testClass = new KMeansColourMatcher(); var rgbPixels = GetTestPixels(Color.Red, 1000); var palette = GetTestPaletteOptions(new Color[0]); var testResult = testClass.GetClosestMatch(rgbPixels, palette); Assert.IsNull(testResult); }
public void SolidColour_ExactMatch() { var testClass = new KMeansColourMatcher(); var rgbPixels = GetTestPixels(Color.Red, 1000); var palette = GetTestPaletteOptions(Color.Red, Color.Blue, Color.Green); var testResult = testClass.GetClosestMatch(rgbPixels, palette); Assert.IsNotNull(testResult); Assert.AreEqual(Color.Red.Name, testResult.Colour.Key); Assert.AreEqual(0, testResult.Distance); }