The JsonResult class is a very useful way to return Json as an action to the client via AJAX.
public JsonResult JoinMailingList(string txtEmail)
{
// ...
Alternatively, if you don't want to get into using reflection, you can create a RouteValueDictionary with the result's Data property. Going with the OP's data...
var jsonData = new RouteValueDictionary(result.Data);
Assert.IsNotNull(jsonData);
Assert.AreEqual(2,
jsonData.Keys.Count);
Assert.AreEqual("123",
jsonData["foo"]);
Assert.AreEqual(true,
jsonData["success"]);