示例#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();
 }
示例#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();
 }