public void ReturnsExpectedRuleSetForRuleSetTypeEnum(RuleSetType ruleSetType, Type expectedType) { _ruleSetsProvider.GetRuleSets().Returns(new Dictionary <RuleSetType, IRuleSet>() { { RuleSetType.Default, new DefaultRuleSet() }, { RuleSetType.Relaxed, new RelaxedRuleSet() } }); var ruleSetFactory = new RuleSetFactory(_ruleSetsProvider); var ruleSet = ruleSetFactory.GetRuleSet(ruleSetType); ruleSet.ShouldBeOfType(expectedType); }
public PhpBotController(IChatBotService chatBotService, IChatSessionService chatSessionService, IExerciseService exerciseService) : base(chatBotService, chatSessionService) { _ruleSet = RuleSetFactory.GetRuleSet("phpCourseRuleSet"); _chatBotName = "PhpChatBot"; _relativeRoute = "/api/php-bot"; _exerciseService = exerciseService; AddRuleSet(RuleSetFactory.GetRuleSet("jokeRuleSet")); AddRuleSet(RuleSetFactory.GetRuleSet("greetingsRuleSet")); AddRuleSet(RuleSetFactory.GetRuleSet("goodbyeRuleSet")); _chatBot = new RestChatBot(_ruleSet.Rules); _chatBot.AddExerciseService(_exerciseService); }