Example #1
0
        public void RunToolBlock_3PossibleResults(CogToolResultConstants blockResult, RunResult expectedRunResult)
        {
            var blockMock      = BlockRunnerMockFactory.CreateCogToolMock(blockResult);
            var blockMockTyped = (CogToolBlockMock)blockMock;
            var blockRunner    = new BlockRunner(ResultMode.OK_NG_Error);

            blockRunner.RunToolBlock(blockMock);

            Assert.True(blockRunner.LastRunResult == expectedRunResult);
            Assert.True(blockMockTyped.RunHasBeenCalled);
        }
Example #2
0
        public void RunToolBlock_4PossibleResultsAndProductPresent(CogToolResultConstants blockResult,
                                                                   RunResult expectedRunResult)
        {
            var blockMock      = BlockRunnerMockFactory.CreateCogToolMock(blockResult);
            var blockMockTyped = (CogToolBlockMock)blockMock;
            var blockRunner    = new BlockRunner(ResultMode.OK_NG_ProductMissing_Error, tool => false);

            blockRunner.RunToolBlock(blockMock);

            Assert.True(blockRunner.LastRunResult == expectedRunResult);
            Assert.True(blockMockTyped.RunHasBeenCalled);
        }