We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We are trying to upgrade an existing project from 1.2.6 to 1.3.0 and are having problems with suddenly breaking tests.
What's the problem with the following test that works in 1.2.6 but not in 1.3.0?
using System.Net.Http; using System.Threading.Tasks; using System.Web.Http; using MyTested.WebApi; using NUnit.Framework; namespace TestApi.Tests.Controllers { public class ValuesController : ApiController { [HttpPost] [Route("api/value")] public async Task<int> GetValue(TestRequest request) { return await (Task.FromResult(request.Value)); } } public class TestRequest { public int Value { get; set; } } [TestFixture] public class ValuesControllerTest { [Test] public void Has_Correct_Route() { MyWebApi.Routes() .ShouldMap("api/value") .WithHttpMethod(HttpMethod.Post) .WithJsonContent("{ value: 1 }") .To<ValuesController>(c => c.GetValue(new TestRequest { Value = 1 })); } } }
The text was updated successfully, but these errors were encountered:
We have a similar issue. With 1.2.6, the following did work:
MyWebApi .Routes() .ShouldMap(requestUrl) .WithHttpMethod(routesToActionMapPost.ContainsKey(routeActionPair.Key) ? HttpMethod.Post : HttpMethod.Get) .ToAction(routeActionPair.Value);
and now with 1.3.0 it fails with the following error:
Expected route '/api/projects/54?var=20' to match 'Get' action but instead matched ''.
Sorry, something went wrong.
No branches or pull requests
We are trying to upgrade an existing project from 1.2.6 to 1.3.0 and are having problems with suddenly breaking tests.
What's the problem with the following test that works in 1.2.6 but not in 1.3.0?
The text was updated successfully, but these errors were encountered: