p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 (http://p2p.wrox.com/forumdisplay.php?f=490)
-   -   UpdateModel (http://p2p.wrox.com/showthread.php?t=78336)

tedr February 24th, 2010 01:21 PM

UpdateModel
 
when running this test the updateModel didn't return a result result is null[:confused:]

[TestMethod]
public void EditAction_Should_Redirect_When_Update_Successful( ) {

// Arrange
var controller = CreateDinnersControllerAs("SomeUser");
int id = 1;

FormCollection formValues = new FormCollection() {
{ "Title", "Another value" },
{ "Description", "Another description" }
};

controller.ValueProvider = formValues.ToValueProvider();

// Act
var result = controller.Edit(id, formValues) as RedirectToRouteResult;

// Assert
Assert.AreEqual("Details", result.RouteValues["Action"]);
Assert.AreEqual(id, result.RouteValues["id"]);
}

tedr February 27th, 2010 06:43 AM

Problem solved
 
The updateModel problem was solved by un-installed MVC 2,
and install MVC 2 RC 2, this updated the Forms Collection get method.[:)]


All times are GMT -4. The time now is 07:42 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.