public ActionResult SemanticNetwork() { return(HandleHttpGetRequest( currentSessionShouldExist: true, tryExecute: () => { var semanticNetwork = _currentSessionOfExpertsService.GetSemanticNetwork(); return View("SemanticNetwork", semanticNetwork); }, andIfFailReturn: RedirectToAction("CurrentSession"))); }
public void SemanticNetwork_SessionExists_DisplaySemanticNetworkView() { var controllerUnderTest = CreateControllerUnderTest(); SetFakeCurrentSession(); var semanticNetwork = new SemanticNetworkReadModel(new List <ConceptReadModel>()); _fakeAdminCurrentSessionOfExpertsService.GetSemanticNetwork() .Returns(semanticNetwork); var result = (ViewResult)controllerUnderTest.SemanticNetwork(); Assert.AreEqual("SemanticNetwork", result.ViewName); Assert.AreEqual(semanticNetwork, result.Model); }