Thread: UpdateModel
View Single Post
  #1 (permalink)  
Old February 24th, 2010, 01:21 PM
tedr tedr is offline
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"]);
}