Пример #1
0
        public static async void CheckCredentialsWithValidAndInValidAndReturnTrue()
        {
            //Arrange
            IGameDataRepository _gameDataRepository = MockData.GetIGameDataRepository(true);

            Account wrongAccount = new Account
            {
                Username   = new Bogus.DataSets.Hacker().Phrase(),
                Password   = new Bogus.DataSets.Hacker().Phrase(),
                OnServerId = "en"
            };
            Account validAccount = SecretData.GetValidTestAccount();

            //Act
            ConnectResult result1 = await _gameDataRepository.TestAccountASync(wrongAccount);

            ConnectResult result2 = await _gameDataRepository.TestAccountASync(validAccount);

            //Assert
            Assert.False(result1.IsConnected);
            Assert.True(result2.IsConnected);
        }
Пример #2
0
        public static async void FullTW2DataHarvest()
        {
            //Arrange
            IGameDataRepository _gameDataRepository = MockData.GetIGameDataRepository(true);
            Account             account             = SecretData.GetValidTestAccount();

            //Act
            _gameDataRepository.InsertOrUpdateAccount(account);
            await _gameDataRepository.TestAccountASync(account);

            Account foundAccount = _gameDataRepository.GetAccount(account.Id);

            //Assert
            Assert.NotNull(foundAccount);
            Assert.NotNull(foundAccount.TW2AccountID);

            //Act
            var result = await _gameDataRepository.EstablishConnection(foundAccount);

            //Assert
            Assert.True(result);
        }
Пример #3
0
 public async Task <ConnectResult> TestAccountASync(Account account)
 {
     return(await _gameDataRepository.TestAccountASync(account));
 }