Esempio n. 1
0
 public void DoSecond(Red red, Green green)
 {
     if (red != null)
     {
         ColorsOperator.Do(red, this);
     }
     if (green != null)
     {
         ColorsOperator.Do(green, this);
     }
 }
Esempio n. 2
0
 public void DoSecond(Green first)
 {
     if (GetRed() != null)
     {
         ColorsOperator.Do(first, GetRed());
     }
     if (GetGreen() != null)
     {
         ColorsOperator.Do(first, GetGreen());
     }
 }
Esempio n. 3
0
        public void SimpleTest()
        {
            var red   = (IColor) new Red();
            var green = (IColor) new Green();

            ColorsOperator.Do(red, red);
            Assert.IsTrue(ColorsOperator.RedRed);

            ColorsOperator.Do(red, green);
            Assert.IsTrue(ColorsOperator.RedGreen);

            ColorsOperator.Do(green, red);
            Assert.IsTrue(ColorsOperator.GreenRed);

            ColorsOperator.Do(green, green);
            Assert.IsTrue(ColorsOperator.GreenGreen);
        }
Esempio n. 4
0
        public void Do()
        {
            switch (_types)
            {
            case "RedRed":
                ColorsOperator.Do(_reds[0], _reds[1]);
                break;;

            case "RedGreen":
                ColorsOperator.Do(_reds[0], _greens[1]);
                break;;

            case "GreenRed":
                ColorsOperator.Do(_greens[0], _reds[1]);
                break;;

            case "GreenGreen":
                ColorsOperator.Do(_greens[0], _greens[1]);
                break;;
            }
        }
Esempio n. 5
0
 public void DoSecond(Red first)
 {
     ColorsOperator.Do(first, this);
 }