MyTested.AspNetCore.Mvc
MyTested.AspNetCore.Mvc copied to clipboard
Support for persisting state between controllers
MyController<MyMvcController>
.Instance()
.WithUser(user => user
.WithUsername("MyUserName"))
.Calling(c => c.MyAction(myRequestModel))
.ShouldHave()
.ValidModelState()
.AndAlso()
.ShouldReturn()
.View(result => result
.WithModelOfType<MyResponseModel>()
.Passing(model =>
{
Assert.AreEqual(1, model.Id);
Assert.AreEqual("My property value", model.MyProperty);
}));
.AndContinueTo<AnotherController>() // .AndContinueTo may not be a goog name
.Calling((c, r) => c.AnotherAction(r.Id))
.ShouldReturn()
.View();