public void DisplayRuleDisplaysNothingIfApplicable() { IPreCommand c = new DisplayRecommendedRule(); var rs = new RuleSet(); var a = new AlchemyController( rs ); var t = new TestCommunicator(); t.DisplayCalled += ( o, e ) => Assert.IsTrue( string.IsNullOrEmpty( (string) o ) ); var result = c.Run( a, t ); Assert.AreEqual( Do.KeepProcessing, result ); }
public void DisplayRuleDisplaysRuleIfApplicable() { IPreCommand c = new DisplayRecommendedRule(); var rs = new RuleSet() { FoundElements = TestTools.GenerateElements( 1 ) }; var a = new AlchemyController( rs ); var t = new TestCommunicator(); int count = 0; t.DisplayCalled += ( o, e ) => { count++; Assert.IsTrue( ( (string) o ).Contains( "+" ) ); }; var result = c.Run( a, t ); Assert.AreEqual( Do.KeepProcessing, result ); Assert.AreEqual( 1, count ); }
public void DisplayRuleCommandExists() { IPreCommand c = new DisplayRecommendedRule(); }