Exemplo n.º 1
0
        /// <summary>
        /// Replace any undefined components with the standard component implementations
        /// </summary>
        public static void ComponentNullCheck()
        {
            if (inputHandler == null)
            {
                inputHandler = new FileReader();
                Log("No InputHandler supplied, using standard implementation");
            }

            if (parameterHandler == null)
            {
                parameterHandler = new InternalParameterHandler();
                Log("No ParameterHandler supplied, using standard implementation");
            }

            if (testExecutor == null)
            {
                testExecutor = new TestExecutor();
                Log("No TestExecutor supplied, using standard implementation");
            }

            if (resultValidator == null)
            {
                resultValidator = new ResultValidator();
                Log("No ResultValidator supplied, using standard implementation");
            }

            if (outputHandler == null)
            {
                outputHandler = new FileWriter();
                Log("No OutputHandler supplied, using standard implementation");
            }
        }
Exemplo n.º 2
0
 public CreateCourseCommandHandler(IMimoDbContext dbContext,
                                   IMapper mapper,
                                   IQueryHandler <CourseNameIsUniqueQuery, bool> uniqueCourseNameHandler,
                                   IResultValidator <CreateCourseCommand> createCourseValidator)
 {
     this.dbContext = dbContext;
     this.mapper    = mapper;
     this.uniqueCourseNameHandler = uniqueCourseNameHandler;
     this.createCourseValidator   = createCourseValidator;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Initialize the system by storing the objects to use for different parts of the system.
        /// </summary>
        /// <param name="input">An object implementing the input handler system component.</param>
        /// <param name="executor">An object implementing the test executor system component.</param>
        /// <param name="validator">An object implementing the result validator system component.</param>
        /// <param name="output">An object implementing the output handler system component.</param>
        public static void Initialize(IInputHandler input    = null, IInternalParameterHandler parameter = null,
                                      ITestExecutor executor = null, IResultValidator validator          = null, IOutputHandler output = null)
        {
            inputHandler     = input;
            parameterHandler = parameter;
            testExecutor     = executor;
            resultValidator  = validator;
            outputHandler    = output;

            ChecksumVerification = false;
        }
 public CompleteLessonCommandHandler(IMimoDbContext dbContext,
                                     IMapper mapper,
                                     IUserAchievementsUpdater userAchievementsUpdater,
                                     IAchievementTypesToUpdateCalculator achievementTypesCalculator,
                                     IResultValidator <CompleteLessonCommand> completeLessonValidator)
 {
     this.dbContext = dbContext;
     this.mapper    = mapper;
     this.userAchievementsUpdater    = userAchievementsUpdater;
     this.achievementTypesCalculator = achievementTypesCalculator;
     this.completeLessonValidator    = completeLessonValidator;
 }