Verifying the type of an AggregateException's inner exception in a unit test
I am blocking the call using AsTask().Result, is this the most appropriate method?


Can't you use await? Most testing frameworks (apparently including MSTest) support async tests. That way, you could work directly with the inner exception instead of the AggregateException.



if (ae.InnerException.GetType() == typeof(InvalidOperationException))
{
    Assert.IsTrue(true);
}
else
{
    Assert.Fail("There was no InvalidOperationException.");
}


I think this should be shortened to just:

Assert.AreEqual(typeof(InvalidOperationException), ae.InnerException.GetType());


Or maybe:

Assert.AreEqual(
    typeof(InvalidOperationException), ae.InnerException.GetType(),
    "There was no InvalidOperationException.");





  Exceptions thrown in an asynchronous chain return AggregateException so I want to inspect that it throws the exception which I defined as "you are not logged in".


But you're not doing that, you're just checking that it's InvalidOperationException. If you want to test for this, maybe you should use a custom exception type?