예제 #1
0
 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 );
 }
예제 #2
0
 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 );
 }
예제 #3
0
 public void DisplayRuleCommandExists()
 {
     IPreCommand c = new DisplayRecommendedRule();
 }