public ExecuteModuleHeader ( PortalRequestContext portalContext, |
||
portalContext | PortalRequestContext | |
moduleResult | ||
Résultat | void |
public void ExecuteModuleHeader_Does_Nothing_If_ModuleResult_Does_Not_Implement_IHeaderContributingResult() { // Arrange var mockResult = new Mock<ActionResult>(); PortalRequestContext context = new PortalRequestContext(Mockery.CreateMockHttpContext()); ModuleRequestResult result = new ModuleRequestResult() { ActionResult = mockResult.Object, ControllerContext = Mockery.CreateMockControllerContext() }; ModuleExecutionEngine engine = new ModuleExecutionEngine(); // Act engine.ExecuteModuleHeader(context, result); // Assert (nothing happened?) }
public void ExecuteModuleHeader_Executes_ModuleResult_Header_If_It_Implements_IHeaderContributingResult() { // Arrange var mockResult = new Mock<ActionResult>(); mockResult.As<IHeaderContributingResult>(); PortalRequestContext context = new PortalRequestContext(Mockery.CreateMockHttpContext()); ModuleRequestResult result = new ModuleRequestResult() { ActionResult = mockResult.Object, ControllerContext = Mockery.CreateMockControllerContext() }; ModuleExecutionEngine engine = new ModuleExecutionEngine(); // Act engine.ExecuteModuleHeader(context, result); // Assert mockResult.As<IHeaderContributingResult>() .Verify(r => r.ExecuteHeader(result.ControllerContext)); }