Exemplo n.º 1
0
        public void UrlForInterfaceShouldReturnCorrectUrl()
        {
            var vm = new TestUrlViewModel()
            {
                TestUrl = new TestUrl()
            };

            ActionFactory.Actions.Add(typeof(TestUrl), new ActionInfo());
            RouteTable.Routes.Add(typeof(TestUrl).FullName, new Route("fakeUrl", null));

            var html = MvcMockHelpers.GetHtmlHelper(vm);
            html.Form(vm.TestUrl);

            Assert.AreEqual(typeof(TestUrl), html.ViewContext.HttpContext.Items[TagGenerator.FORMINPUTTYPE]);
        }
Exemplo n.º 2
0
        public void UrlForInterfaceShouldReturnCorrectUrl()
        {
            var vm = new TestUrlViewModel()
            {
                TestUrl = new TestUrl()
            };

            ActionFactory.Actions.Add(typeof(TestUrl), new ActionInfo());
            RouteTable.Routes.Add(typeof(TestUrl).FullName, new Route("fakeUrl", null));

            var html = MvcMockHelpers.GetHtmlHelper(vm);

            html.Form(vm.TestUrl);

            Assert.AreEqual(typeof(TestUrl), html.ViewContext.HttpContext.Items[TagGenerator.FORMINPUTTYPE]);
        }