public void WhenTheUserIsRetrieved_ThenNullIsReturned() { service.Setup(s => s.GetUser()).Returns((User)null); UserHub hub = new TestableUserHub(service.Object, null); hub.GetUser().Result.As<UserViewModel>().Should().BeNull(); }
public void WhenTheUserIsRetrieved_ThenTheUserIsAuthenticated() { service.Setup(s => s.GetUser()).Returns(new User()); UserHub hub = new TestableUserHub(service.Object, "Kevin"); hub.GetUser().Result.As<UserViewModel>().IsAuthenticated.Should().BeTrue(); }