Exemple #1
0
        public void AnotherBasicRoute_WithOneParametersBetweenStaticContent()
        {
            string js         = this.generator.Build("Home", "product/{id}/details");
            string expectedJs = @"Url.AddRoute('Home', function(params) {
                                    return baseUrl.concat('product/', params.id, '/details');
                                  });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #2
0
        public void AnotherBasicRoute_WithTwoParameters()
        {
            string js         = this.generator.Build("Home", "{controller}/{action}");
            string expectedJs = @"Url.AddRoute('Home', function(params) {
                                    return baseUrl.concat(params.controller, '/', params.action);
                                  });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #3
0
        public void AnotherBasicRoute_WithTwoParameters_WithStaticContentBetweenIt()
        {
            string js         = this.generator.Build("Home", "Home/{controller}/List/{category}");
            string expectedJs = @"Url.AddRoute('Home', function(params) {
                                    return baseUrl.concat('Home/', params.controller, '/List/', params.category);
                                  });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #4
0
        public void AnotherBasicRoute_WithOneParameter()
        {
            string js         = this.generator.Build("Admin_Default", "Index/{controller}");
            string expectedJs = @"Url.AddRoute('Admin_Default', function(params) {
                                    return baseUrl.concat('Index/', params.controller);
                                  });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #5
0
        public void BasicRoute_WithOneParameter()
        {
            string js         = this.generator.Build("Home", "Home/Index/{id}");
            string expectedJs = @"Url.AddRoute('Home', function(params) {
                                    return baseUrl.concat('Home/Index/', params.id);
                                  });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #6
0
        public void BasicRoute()
        {
            string js         = this.generator.Build("Home", "Home/Index");
            string expectedJs = @"Url.AddRoute('Home', function() {
                                    return baseUrl.concat('Home/Index');
                                  });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #7
0
        public void BasicRoute_WithTwoDefaultValue()
        {
            var    defaults   = this.BuildDefaults(new { controller = "Home", action = "Index" });
            string js         = this.generator.Build("Home", "{controller}/{action}", defaults);
            string expectedJs = @"Url.AddRoute('Home', function(params) {
                                    return baseUrl.concat(params.controller, '/', params.action);
                                  }, { controller: 'Home', action: 'Index' });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }
Exemple #8
0
        public void BasicRoute_WithOneDefaultValue()
        {
            var    defaults   = this.BuildDefaults(new { id = "2" });
            string js         = this.generator.Build("Home", "Home/Index/{id}", defaults);
            string expectedJs = @"Url.AddRoute('Home', function(params) {
                                    return baseUrl.concat('Home/Index/', params.id);
                                  }, { id: '2' });";

            JavaScriptAssert.AreEqual(expectedJs, js);
        }