Json

_controller.WithCallTo(c => c.Index()).ShouldReturnJson(); _controller.WithCallTo(c => c.Index()).ShouldReturnJson(data => { /* Assertions on the data being turned into json (data), e.g. if you are using NUnit, you might have something like: */ Assert.That(data.SomeProperty, Is.EqualTo("SomeValue"); });

Did this page help you?