public async Task LoginAsRegisteredUserAsync()
        {
            //Prepare
            Mock<LoginStatusChangedEvent> loginStatusChangedEvent = new Mock<LoginStatusChangedEvent>();
            loginStatusChangedEvent.Setup(x => x.Publish(It.IsAny<IUserService>())).Verifiable();

            Mock<IEventAggregator> eventAggregator = new Mock<IEventAggregator>();
            eventAggregator.Setup(x => x.GetEvent<LoginStatusChangedEvent>()).Returns(loginStatusChangedEvent.Object);

            string user = "******";
            char[] pass = "******".ToCharArray();
            SecureString password = new SecureString();
            foreach (char c in pass)
            {
                password.AppendChar(c);
            } 

            //Act 
            IUserService target = new BattlenetService(eventAggregator.Object);
            UserQueryResult result = await target.LoginAsync(user, password);

            //Verify
            Assert.AreEqual(user, target.CurrentUser.Username);
            Assert.IsTrue(target.IsLoggedIn);
            Assert.IsTrue(result.Success);
            Assert.AreEqual(OnlineStatuses.Online, target.OnlineStatus);
            loginStatusChangedEvent.VerifyAll();
        }
        public async Task LoginWithUnregisteredUserAsync()
        {
            //Prepare
            Mock<LoginStatusChangedEvent> loginStatusChangedEvent = new Mock<LoginStatusChangedEvent>();
            loginStatusChangedEvent.Setup(x => x.Publish(It.IsAny<IUserService>())).Verifiable();

            Mock<IEventAggregator> eventAggregator = new Mock<IEventAggregator>();
            eventAggregator.Setup(x => x.GetEvent<LoginStatusChangedEvent>()).Returns(loginStatusChangedEvent.Object);

            string user = "******";
            char[] pass = "******".ToCharArray();
            SecureString password = new SecureString();
            foreach (char c in pass)
            {
                password.AppendChar(c);
            }

            //Act 
            IUserService target = new BattlenetService(eventAggregator.Object);
            UserQueryResult result = await target.LoginAsync(user, password);

            //Verify
            Assert.IsNull(target.CurrentUser);
            Assert.IsFalse(target.IsLoggedIn);
            Assert.IsFalse(result.Success);
            Assert.AreEqual(UserQueryResult.ResultCode.LogginFailed, result.Code);
            loginStatusChangedEvent.Verify(x => x.Publish(It.IsAny<IUserService>()), Times.Never);
        }