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()); }
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()); }
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()); }
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()); }
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()); }
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()); }
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()); }