Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9
This is the forum to discuss the Wrox book Professional ASP.NET MVC 1.0 by Rob Conery, Scott Hanselman, Phil Haack, Scott Guthrie; ISBN: 978-0-470-38461-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 24th, 2010, 01:21 PM
Authorized User
 
Join Date: Mar 2009
Posts: 68
Thanks: 6
Thanked 0 Times in 0 Posts
Default UpdateModel

when running this test the updateModel didn't return a result result is null

[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"]);
}
  #2 (permalink)  
Old February 27th, 2010, 06:43 AM
Authorized User
 
Join Date: Mar 2009
Posts: 68
Thanks: 6
Thanked 0 Times in 0 Posts
Default 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.






Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.