public void DoSecond(Red red, Green green) { if (red != null) { ColorsOperator.Do(red, this); } if (green != null) { ColorsOperator.Do(green, this); } }
public void DoSecond(Green first) { if (GetRed() != null) { ColorsOperator.Do(first, GetRed()); } if (GetGreen() != null) { ColorsOperator.Do(first, GetGreen()); } }
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); }
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;; } }
public void DoSecond(Red first) { ColorsOperator.Do(first, this); }