Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 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();
 }