I've got a controller method that returns this to the client
return Ok(new { user, profile});
It used to return the user object on its own, so my unit test on the method looked like this
var res = await _controller.Get(_userId);
var okResult = res as OkObjectResult;
var resUser = okResult.Value as User;
i could then test individule bits of my return
Assert.Contains("user@domain.com", resUser.EmailAddress);
However, now i'm returning a a tuple object our of the controller method its not working. Ive tried doing
var resUser1 = okResult.Value as Tuple<User, Profile>;
But that always returns me null. Any idea how i can convert my result from the controller into something i can look into now its not just a flat object?
Thanks