public void GetCurrentUser_returns_null_when_they_are_not_logged_in([Frozen] IIdentityReader identityReader, [Frozen, InMemory] IEntityData query, CurrentUserReader sut) { // Arrange Mock.Get(identityReader) .Setup(x => x.GetCurrentUserInfo()) .Returns((ICurrentUserInfo)null); // Act var result = sut.GetCurrentUser(); // Assert Assert.IsNull(result); }
public void GetCurrentUser_returns_null_when_they_are_not_found([Frozen] IIdentityReader identityReader, [Frozen, InMemory] IEntityData query, CurrentUserReader sut, ICurrentUserInfo userInfo, [HasIdentity] User user) { // Arrange SetupCurrentUserIdentity(user, userInfo, identityReader); // Act var result = sut.GetCurrentUser(); // Assert Assert.IsNull(result); }
public void GetCurrentUser_returns_user_when_they_are_logged_in([Frozen] IIdentityReader identityReader, [Frozen, InMemory] IEntityData query, CurrentUserReader sut, ICurrentUserInfo userInfo, [HasIdentity] User user) { // Arrange FullySetupLoggedInUser(user, userInfo, query, identityReader); // Act var result = sut.GetCurrentUser(); // Assert Assert.AreSame(user, result); }