コード例 #1
0
        public void MismatchFluentMapWithBodyFails()
        {
            var postData = new PostDataModel
            {
                Name = "Jim Spriggs",
                Number = 42
            };
            const string PostBody = "Name=Fred+Bloggers&Number=42";

            var assertEngine = new FakeAssertEngine();
            RouteAssert.UseAssertEngine(assertEngine);

            routes.ShouldMap("/frombody/post/123").WithBody(PostBody).
                To<FromBodyController>(c => c.Post(123, postData));

            Assert.That(assertEngine.StringMismatchCount, Is.EqualTo(1));
            Assert.That(assertEngine.Messages[0], Is.EqualTo("Expected 'Jim Spriggs', not 'Fred Bloggers' for 'name' at url '/frombody/post/123'."));
        }
コード例 #2
0
        public void TestFluentMapWithBody()
        {
            var postData = new PostDataModel
            {
                Name = "Fred Bloggers",
                Number = 42
            };
            const string PostBody = "Name=Fred+Bloggers&Number=42";

            routes.ShouldMap("/frombody/post/123").WithBody(PostBody).
                To<FromBodyController>(c => c.Post(123, postData));
        }
コード例 #3
0
		public ActionResult Post(int id, PostDataModel data)
		{
			return new EmptyResult();
		}
コード例 #4
0
 public ActionResult Post(int id, PostDataModel data)
 {
     return(new EmptyResult());
 }