GetController() 공개 메소드

Returns a controller previously registered.
public GetController ( String areaName, String controllerName ) : Type
areaName String The area name, or String.Empty
controllerName String The controller name
리턴 System.Type
예제 #1
0
		public void EmptyArea()
		{
			DefaultControllerTree tree = new DefaultControllerTree();
			tree.AddController("", "home", typeof(HomeController));
			tree.AddController("", "contact", typeof(ContactController));
			tree.AddController("", "cart", typeof(CartController));

			Assert.AreEqual( typeof(HomeController), tree.GetController("", "home") );
			Assert.AreEqual( typeof(ContactController), tree.GetController("", "contact") );
			Assert.AreEqual( typeof(CartController), tree.GetController("", "cart") );
		}
예제 #2
0
		public void FewAreas()
		{
			DefaultControllerTree tree = new DefaultControllerTree();

			tree.AddController("", "home", typeof(HomeController));
			tree.AddController("", "contact", typeof(ContactController));
			tree.AddController("", "cart", typeof(CartController));
			tree.AddController("clients", "home", typeof(ClientHomeController));
			tree.AddController("clients", "contact", typeof(ClientContactController));
			tree.AddController("clients", "cart", typeof(ClientCartController));
			tree.AddController("lists", "home", typeof(ListController));

			Assert.AreEqual( typeof(HomeController), tree.GetController("", "home") );
			Assert.AreEqual( typeof(ContactController), tree.GetController("", "contact") );
			Assert.AreEqual( typeof(CartController), tree.GetController("", "cart") );

			Assert.AreEqual( typeof(ClientHomeController), tree.GetController("clients", "home") );
			Assert.AreEqual( typeof(ClientContactController), tree.GetController("clients", "contact") );
			Assert.AreEqual( typeof(ClientCartController), tree.GetController("clients", "cart") );

			Assert.AreEqual( typeof(ListController), tree.GetController("lists", "home") );
		}