コード例 #1
0
ファイル: RouteTests.cs プロジェクト: niklas-ngenic/HemTest
 public void Get_ArtistInfo()
 {
     var request = new HttpRequestMessage(HttpMethod.Get, artistInfo);
     var routeTester = new RouteTester(config, request);
     Assert.AreEqual(typeof(ArtistInfoController), routeTester.GetControllerType());
     Assert.AreEqual(ReflectionHelper.GetMethodName((ArtistInfoController c) => c.Get(Guid.NewGuid())), routeTester.GetActionName());
 }
コード例 #2
0
        public void V2_RPC_UrlControllerPostIsCorrect()
        {
            var request = new HttpRequestMessage(HttpMethod.Post, "http://www.strathweb.com/api/v2/url/Add");

            var routeTester = new RouteTester(_config, request);

            Assert.Equal(typeof(UrlController), routeTester.GetControllerType());
            Assert.Equal(ReflectionHelpers.GetMethodName((UrlController p) => p.Add(new Url())), routeTester.GetActionName());
        }
コード例 #3
0
        public void GET_method_has_correct_destination_GetGenres()
        {
            var request = new HttpRequestMessage(HttpMethod.Get, _prefix + "api/platforms");

            var routeTester = new RouteTester(_config, request);

            Assert.AreEqual(typeof(PlatformsController), routeTester.GetControllerType());
            Assert.AreEqual(ReflectionHelper.GetMethodName((PlatformsController p) => p.GetPlatforms()), routeTester.GetActionName());
        }
コード例 #4
0
        public void DELETE_method_has_correct_destination_DeletePublisher()
        {
            var request = new HttpRequestMessage(HttpMethod.Delete, _prefix + "api/publisher/1");

            var routeTester = new RouteTester(_config, request);

            Assert.AreEqual(typeof(PublisherController), routeTester.GetControllerType());
            Assert.AreEqual(ReflectionHelper.GetMethodName((PublisherController p) => p.DeletePublisher(It.IsAny <int>())), routeTester.GetActionName());
        }
コード例 #5
0
        public void POST_method_has_correct_destination_CreatePublisher()
        {
            var request = new HttpRequestMessage(HttpMethod.Post, _prefix + "api/publisher");

            var routeTester = new RouteTester(_config, request);

            Assert.AreEqual(typeof(PublisherController), routeTester.GetControllerType());
            Assert.AreEqual(ReflectionHelper.GetMethodName((PublisherController p) => p.CreatePublisher(It.IsAny <PublisherModel>())), routeTester.GetActionName());
        }
コード例 #6
0
        public void PUT_method_has_correct_destination_EditGenre()
        {
            var request = new HttpRequestMessage(HttpMethod.Put, _prefix + "api/genres/1");

            var routeTester = new RouteTester(_config, request);

            Assert.AreEqual(typeof(GenresController), routeTester.GetControllerType());
            Assert.AreEqual(ReflectionHelper.GetMethodName((GenresController p) => p.EditGenre(It.IsAny <int>(), It.IsAny <GenreModel>())), routeTester.GetActionName());
        }
コード例 #7
0
        public void Get_ArtistInfo()
        {
            var request     = new HttpRequestMessage(HttpMethod.Get, artistInfo);
            var routeTester = new RouteTester(config, request);

            Assert.AreEqual(typeof(ArtistInfoController), routeTester.GetControllerType());
            Assert.AreEqual(ReflectionHelper.GetMethodName((ArtistInfoController c) => c.Get(Guid.NewGuid())), routeTester.GetActionName());
        }