public void Setup() { var mockHookRegistry = new Mock <IHookRegistry>(); var mockSandbox = new Mock <ISandbox>(); mockSandbox.Setup(sandbox => sandbox.GetAllPendingMessages()).Returns(_pendingMessages); var hooks = new HashSet <IHookMethod> { new HookMethod(GetType().GetMethod("Foo"), typeof(Step).Assembly) }; mockHookRegistry.Setup(x => x.AfterSuiteHooks).Returns(hooks); var executionEndingRequest = new ExecutionEndingRequest() { CurrentExecutionInfo = new ExecutionInfo() { CurrentSpec = new SpecInfo(), CurrentScenario = new ScenarioInfo() } }; _request = new Message() { MessageId = 20, MessageType = Message.Types.MessageType.ExecutionEnding, ExecutionEndingRequest = executionEndingRequest }; _mockMethodExecutor = new Mock <IMethodExecutor>(); _protoExecutionResult = new ProtoExecutionResult() { ExecutionTime = 0, Failed = false, }; _protoExecutionResult.Message.AddRange(_pendingMessages); _mockMethodExecutor.Setup(x => x.ExecuteHooks("AfterSuite", It.IsAny <HooksStrategy>(), It.IsAny <IList <string> >())) .Returns(_protoExecutionResult); _executionEndingProcessor = new ExecutionEndingProcessor(_mockMethodExecutor.Object); }