コード例 #1
0
            public void LaunchRequest_ReturnsTypeName()
            {
                var routes = new Dictionary <string, RouteData> {
                    { nameof(LaunchRequest), new RouteData("TestController", "Index") }
                };
                var routeDataService = new RouteDataService(routes);

                var name = routeDataService.GetRouteName(new LaunchRequest {
                    Type = "LaunchRequest"
                });

                Assert.Equal(nameof(LaunchRequest), name);
            }
コード例 #2
0
            public void LaunchRequestHasRoute_ReturnsRouteData()
            {
                var routes = new Dictionary <string, RouteData>
                {
                    { nameof(LaunchRequest), new RouteData("TestController", "Index") }
                };
                var routeDataService = new RouteDataService(routes);

                routeDataService.TryGetRoute(new LaunchRequest {
                    Type = "LaunchRequest"
                }, out var route);

                Assert.True(routes[nameof(LaunchRequest)].Equals(route));
            }
コード例 #3
0
            public void IntentRequestHasRoute_ReturnsTrue()
            {
                var routes = new Dictionary <string, RouteData> {
                    { "Test", new RouteData("TestController", "Index") }
                };
                var routeDataService = new RouteDataService(routes);

                var hasRoute = routeDataService.TryGetRoute(
                    new IntentRequest {
                    Intent = new Intent {
                        Name = "Test"
                    }, Type = "IntentRequest"
                }, out var route);

                Assert.True(hasRoute);
            }
コード例 #4
0
            public void IntentRequestDoesNotHaveRoute_ReturnsNullRouteData()
            {
                var routes = new Dictionary <string, RouteData>
                {
                    { "SomeIntent", new RouteData("TestController", "Index") }
                };
                var routeDataService = new RouteDataService(routes);

                routeDataService.TryGetRoute(
                    new IntentRequest {
                    Intent = new Intent {
                        Name = "Test"
                    }, Type = "IntentRequest"
                }, out var route);

                Assert.Null(route);
            }
コード例 #5
0
            public void IntentRequest_ReturnsIntentName()
            {
                const string intentName = "Test";
                var          routes     = new Dictionary <string, RouteData> {
                    { "Test", new RouteData("TestController", "Index") }
                };
                var routeDataService = new RouteDataService(routes);

                var name = routeDataService.GetRouteName(
                    new IntentRequest {
                    Intent = new Intent {
                        Name = intentName
                    }, Type = "IntentRequest"
                });

                Assert.Equal(intentName, name);
            }
コード例 #6
0
        public IEnumerable <Stretch> GetAllStretch()
        {
            RouteDataService routeData = new RouteDataService();

            return(routeData.GetAllStretch().Select(x => x.ToList()).ToList());
        }