public override void Setup()
 {
   base.Setup();
   _root = new AreaTreeNode("Root");
   _controller = new ControllerTreeNode("HomeController", "ControllerNamespace");
   _root.AddChild(_controller);
 }
예제 #2
0
 public void ViewComponentTreeNode_ToString_GiveInformation()
 {
   ViewComponentTreeNode node = new ViewComponentTreeNode("SomeComponent", "ControllerServices");
   AreaTreeNode rootNode = new AreaTreeNode("Root");
   rootNode.AddChild(node);
   Assert.AreNotEqual(node.GetType().FullName, node.ToString());
   Assert.AreEqual("ControllerServices", node.Namespace);
 }
예제 #3
0
 public void ControllerTreeNode_MultipleToString_GiveInformation()
 {
   ControllerTreeNode node = new ControllerTreeNode("HomeController", "ControllerServices");
   AreaTreeNode rootNode = new AreaTreeNode("Root");
   AreaTreeNode areaNode = new AreaTreeNode("Area");
   areaNode.AddChild(node);
   rootNode.AddChild(areaNode);
   Assert.AreNotEqual(node.GetType().FullName, node.ToString());
 }
예제 #4
0
 public void ControllerTreeNodeArea_Always_WalksUpwards()
 {
   ControllerTreeNode node = new ControllerTreeNode("HomeController", "ControllerServices");
   AreaTreeNode rootNode = new AreaTreeNode("Root");
   AreaTreeNode area1Node = new AreaTreeNode("Area1");
   AreaTreeNode area2Node = new AreaTreeNode("Area2");
   rootNode.AddChild(area1Node);
   area1Node.AddChild(area2Node);
   area2Node.AddChild(node);
   Assert.AreEqual("Area1/Area2", node.Area);
 }
    public void AddViewSource_ViewForValidTopLevelController_AddsViewNode()
    {
      ControllerTreeNode node = new ControllerTreeNode("HomeController", "SomeNamespace");
      AreaTreeNode root = new AreaTreeNode("Root");
      root.AddChild(node);

      using (_mocks.Unordered())
      {
        Expect.Call(_treeService.FindNode("HomeController")).Return(node);
        _treeService.PushNode(node);
        _treeService.PopToRoot();
      }

      _mocks.ReplayAll();
      _mapper.AddViewSource(@"Projects\Eleutian.Web.Site\Views\Home\Index.brail");
      _mocks.VerifyAll();

      AssertHasViewNode(node);
    }
  	private void BuildTestTree()
  	{
  		AreaTreeNode parentAreaNode = new AreaTreeNode("Parent");
  		_root.AddChild(parentAreaNode);

  		AreaTreeNode childAreaNode = new AreaTreeNode("Child");
  		parentAreaNode.AddChild(childAreaNode);

  		ControllerTreeNode controllerNode = new ControllerTreeNode("ChildController", "ControllerNamespace");
  		parentAreaNode.AddChild(controllerNode);
  	}