-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Description
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 }));
}
}
}
Metadata
Metadata
Assignees
Labels
No labels