public async Task GetCurrentIdentityStateAsync_Registered()
		{
			var identityProvider = new Mock<IIdentityProvider>();
			identityProvider
				.Setup(ip => ip.CurrentIdentity)
				.Returns(GetIdentity());

			var userService = new Mock<IUserService>();
			userService
				.Setup(us => us.GetAndUpdateCurrentUserAsync())
				.ReturnsAsync(new User());

			var userProvider = new UserProvider(userService.Object, identityProvider.Object);
			var identityState = await userProvider.GetCurrentIdentityStateAsync();

			Assert.Equal(IdentityState.Registered, identityState);
		}
		public async Task GetCurrentIdentityStateAsync_NotSignedIn()
		{
			var identityProvider = new Mock<IIdentityProvider>();
			identityProvider
				.Setup(ip => ip.CurrentIdentity)
				.Returns<Model.Users.Identity>(null);

			var userService = new Mock<IUserService>();
			userService
				.Setup(us => us.AnyRegisteredUsersAsync())
				.ReturnsAsync(true);

			var userProvider = new UserProvider(userService.Object, identityProvider.Object);
			var identityState = await userProvider.GetCurrentIdentityStateAsync();

			Assert.Equal(IdentityState.Anonymous, identityState);
		}
		public async Task IsServiceActivatedAsync_SignedInAsRegisteredUser_ReturnsTrue()
		{
			var identityProvider = new Mock<IIdentityProvider>();
			identityProvider
				.Setup(ip => ip.CurrentIdentity)
				.Returns(GetIdentity());

			var user = new User();
			var userService = new Mock<IUserService>();
			userService
				.Setup(us => us.GetAndUpdateCurrentUserAsync())
				.ReturnsAsync(new User());

			var userProvider = new UserProvider(userService.Object, identityProvider.Object);
			var result = await userProvider.IsServiceActivatedAsync();

			Assert.True(result);
			userService.Verify(us => us.AnyRegisteredUsersAsync(), Times.Never);
		}
		public async Task IsServiceActivatedAsync_NotSignedInAndRegisteredUsers_ReturnsTrue()
		{
			var identityProvider = new Mock<IIdentityProvider>();

			var user = new User();
			var userService = new Mock<IUserService>();
			userService
				.Setup(us => us.GetAndUpdateCurrentUserAsync())
				.ReturnsAsync(null);
			userService
				.Setup(us => us.AnyRegisteredUsersAsync())
				.ReturnsAsync(true);

			var userProvider = new UserProvider(userService.Object, identityProvider.Object);
			var result = await userProvider.IsServiceActivatedAsync();

			Assert.True(result);
		}
		public async Task GetCurrentUserAsync_Unregistered_ReturnsNull()
		{
			var identityProvider = new Mock<IIdentityProvider>();

			var user = new User();
			var userService = new Mock<IUserService>();
			userService
				.Setup(us => us.GetAndUpdateCurrentUserAsync())
				.ReturnsAsync(null);

			var userProvider = new UserProvider(userService.Object, identityProvider.Object);
			var currentUser = await userProvider.GetCurrentUserAsync();

			Assert.Null(currentUser);
		}