The simplest approach would probably be to use dynamic typing:
dynamic foo = ret.Data;
Assert.AreEqual("OK", foo.status);
Note that you'll need to use [InternalsVisibleTo]
in order to give your unit test assembly access to the anonymous type in your production assembly, as it will be generated with internal
access.
Alternatively, just use reflection.