MyTested.AspNetCore.Mvc icon indicating copy to clipboard operation
MyTested.AspNetCore.Mvc copied to clipboard

Support for persisting state between controllers

Open ivaylokenov opened this issue 6 years ago • 0 comments

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();

ivaylokenov avatar Jul 07 '19 15:07 ivaylokenov