public void CohortsRulesProcessor_EnqueueCohortRuleWhenProcessingThreadNotRunning_ShouldThrow() { //Arrange var mockCareMemberCohortRuleFactory = new Mock <ICareMemberCohortRuleFactory>(); var mockContactDataController = new Mock <IContactEndpointUtil>(); var mockLogger = new Mock <ILogger>(); var mockCohortRuleUtil = new Mock <ICohortRuleUtil>(); var cohortRulesProcessor = new CohortRulesProcessor(mockCareMemberCohortRuleFactory.Object, mockContactDataController.Object, mockCohortRuleUtil.Object, mockLogger.Object); //Assert cohortRulesProcessor.EnqueueCohorRuleCheck(new CohortRuleCheckData()); }
public void CohortsRulesProcessor_EnqueueCohortRule_Success() { //Arrange var mockCareMemberCohortRuleFactory = new Mock <ICareMemberCohortRuleFactory>(); var mockContactDataController = new Mock <IContactEndpointUtil>(); var mockLogger = new Mock <ILogger>(); var mockCohortRuleUtil = new Mock <ICohortRuleUtil>(); var cohortRulesProcessor = new CohortRulesProcessor(mockCareMemberCohortRuleFactory.Object, mockContactDataController.Object, mockCohortRuleUtil.Object, mockLogger.Object); cohortRulesProcessor.Start(); //Act for (int i = 0; i < 20; i++) { cohortRulesProcessor.EnqueueCohorRuleCheck(new CohortRuleCheckData()); } //Assert Assert.IsTrue(cohortRulesProcessor.GetQueueCount() > 0); cohortRulesProcessor.Stop(); }