Classify() public method

public Classify ( Bgr value ) : CardColor
value Bgr
return CardColor
Ejemplo n.º 1
0
 public void ClassifyTest()
 {
     BgrClassifier target = new BgrClassifier();
     Bgr value = new Bgr(145, 110, 197); //Purple
     CardColor actual = target.Classify(value);
     Assert.AreEqual(CardColor.Purple, actual);
 }
Ejemplo n.º 2
0
        public static void Test()
        {
            BgrClassifier clas = new BgrClassifier();
            CardColor c1 = clas.Classify(new Bgr(145, 110, 197));  //Purple
            CardColor c2 = clas.Classify(new Bgr(255, 255, 255));  //White?
            CardColor c3 = clas.Classify(new Bgr(0, 0, 250));  //Red
            CardColor c4 = clas.Classify(new Bgr(53, 0, 250));  //Red
            CardColor c5 = clas.Classify(new Bgr(250, 0, 250));  //Purple
            CardColor c6 = clas.Classify(new Bgr(250, 0, 251));  //Purple
            CardColor c7 = clas.Classify(new Bgr(240, 0, 240));  //Purple
            CardColor c8 = clas.Classify(new Bgr(145, 110, 194));  //Purple

            bool ok1 = CardColor.Purple    == c1;  //Purple
            bool ok2 = CardColor.White     == c2;  //White?
            bool ok3 = CardColor.Red       == c3;  //Red
            bool ok4 = CardColor.Red       == c4;  //Red
            bool ok5 = CardColor.Purple    == c5;  //Purple
            bool ok6 = CardColor.Purple    == c6;  //Purple
            bool ok7 = CardColor.Purple    == c7;  //Purple
            bool ok8 = CardColor.Purple    == c8;  //Purple
        }