Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            int        pairNumber = 4;
            ColorPairs testPair1  = GetColorFromPairNumbers.GetColorFromPairNumber(pairNumber);

            Console.WriteLine("[In]Pair Number: {0},[Out] Colors: {1}\n", pairNumber, testPair1);
            Debug.Assert(testPair1.majorColor == Color.White);
            Debug.Assert(testPair1.minorColor == Color.Brown);

            pairNumber = 5;
            testPair1  = GetColorFromPairNumbers.GetColorFromPairNumber(pairNumber);
            Console.WriteLine("[In]Pair Number: {0},[Out] Colors: {1}\n", pairNumber, testPair1);
            Debug.Assert(testPair1.majorColor == Color.White);
            Debug.Assert(testPair1.minorColor == Color.SlateGray);

            pairNumber = 23;
            testPair1  = GetColorFromPairNumbers.GetColorFromPairNumber(pairNumber);
            Console.WriteLine("[In]Pair Number: {0},[Out] Colors: {1}\n", pairNumber, testPair1);
            Debug.Assert(testPair1.majorColor == Color.Violet);
            Debug.Assert(testPair1.minorColor == Color.Green);

            //ColorPairs testPair2 = new ColorPairs() { majorColor = Color.Yellow, minorColor = Color.Green };
            //pairNumber = GetPairNumberFromColors.GetPairNumberFromColor(testPair2);
            //Console.WriteLine("[In]Colors: {0}, [Out] PairNumber: {1}\n", testPair2, pairNumber);
            //Debug.Assert(pairNumber == 18);

            //testPair2 = new ColorPairs() { majorColor = Color.Red, minorColor = Color.Blue };
            //pairNumber = GetPairNumberFromColors.GetPairNumberFromColor(testPair2);
            //Console.WriteLine("[In]Colors: {0}, [Out] PairNumber: {1}", testPair2, pairNumber);
            //Debug.Assert(pairNumber == 6);

            ColorPairMap map = new ColorPairMap();

            Console.WriteLine(map.ToString());
        }
Ejemplo n.º 2
0
        public override string ToString()
        {
            int    totalCombinations = CopyOfColorMapMajor.Length * CopyOfColorMapMinor.Length;
            String Result            = null;

            for (int pairno = 1; pairno <= totalCombinations; pairno++)
            {
                ColorPairs pair = GetColorFromPairNumbers.GetColorFromPairNumber(pairno);
                Result += "Pair number: " + pairno.ToString() + " " + "Color Pair: " + pair.ToString() + '\n';
            }

            return(Result);
        }