Example #1
0
        public void Render_NoArea_SetsSelectedView()
        {
            var reference = new ControllerViewReference(services, typeof(TestController), "", "Test", "Action");

            reference.Render();

            Assert.AreEqual(@"Test\Action", controller.SelectedViewName);
        }
		public void Render_NoArea_SetsSelectedView()
		{
			var reference = new ControllerViewReference(services, typeof (TestController), "", "Test", "Action");

			reference.Render();
			
			Assert.AreEqual(@"Test\Action", controller.SelectedViewName);
		}
Example #3
0
        public void Constructor_Always_ProperlyInitializes()
        {
            var reference = new ControllerViewReference(services, typeof(TestController), "Area", "Test", "Action");

            Assert.AreEqual("Action", reference.ActionName);
            Assert.AreEqual("Area", reference.AreaName);
            Assert.AreEqual("Test", reference.ControllerName);
            Assert.AreEqual(typeof(TestController), reference.ControllerType);
        }
		public void Constructor_Always_ProperlyInitializes()
		{
			ControllerViewReference reference =
				new ControllerViewReference(_services, typeof (TestController), "Area", "Test", "Action");
			Assert.AreEqual("Action", reference.ActionName);
			Assert.AreEqual("Area", reference.AreaName);
			Assert.AreEqual("Test", reference.ControllerName);
			Assert.AreEqual(typeof (TestController), reference.ControllerType);
		}
		public void Render_Always_SetsSelectedView()
		{
			Controller controller = new TestController();
			controller.ControllerContext = _mocks.Stub<IControllerContext>();
			ControllerViewReference reference =
				new ControllerViewReference(_services, typeof (TestController), "Area", "Test", "Action");

			using (_mocks.Unordered())
			{
				Expect.Call(_services.Controller).Return(controller).Repeat.Any();
			}

			_mocks.ReplayAll();
			reference.Render();
			_mocks.VerifyAll();

			Assert.AreEqual(@"Area\Test\Action", controller.SelectedViewName);
		}
Example #6
0
        public void Render_NoArea_SetsSelectedView()
        {
            Controller controller = new TestController();

            controller.ControllerContext = _mocks.Stub <IControllerContext>();
            ControllerViewReference reference =
                new ControllerViewReference(_services, typeof(TestController), "", "Test", "Action");

            using (_mocks.Unordered())
            {
                Expect.Call(_services.Controller).Return(controller).Repeat.Any();
            }

            _mocks.ReplayAll();
            reference.Render();
            _mocks.VerifyAll();

            Assert.AreEqual(@"Test\Action", controller.SelectedViewName);
        }