private async Task<UserCredential> GoogleSignin(string username)
 {
     var googleAuthenticator = new AuthenticationGoogle();
     await googleAuthenticator.LoginGoogle(username);
     var currentUserCredentials = googleAuthenticator.GetCurrentCredentials();
     _googleApiClient = new GoogleApiClient(currentUserCredentials);
     return currentUserCredentials;
 }
 public async Task GetUserBirthdayTest()
 {
     var googleAuthenticator = new AuthenticationGoogle();
     await googleAuthenticator.LoginGoogle(_testUsername);
     var googleApiClient = new GoogleApiClient(googleAuthenticator.GetCurrentCredentials());
     var googleCorrelatorBot = new GoogleDataCorrelator(googleApiClient.GetEventsUser(), googleApiClient.GetGmailsUser(), googleApiClient.GetCurrentUser());
     var correlation = googleCorrelatorBot.GetUserBirthday();
     Assert.IsNotNull(correlation);
 }
 public async Task StartBotClientTest()
 {
     var googleAuthenticator = new AuthenticationGoogle();
     await googleAuthenticator.LoginGoogle(_testUsername);
     var googleApiClient = new GoogleApiClient(googleAuthenticator.GetCurrentCredentials());
     var bot = BotClient.GetBotClientInstance();
     Assert.IsNotNull(bot.StartBotClient(googleApiClient.GetEventsUser(), googleApiClient.GetGmailsUser(),
         googleApiClient.GetCurrentUser()));
 }
 private async Task<BotClient> SetupBot()
 {
     var googleAuthenticator = new AuthenticationGoogle();
     await googleAuthenticator.LoginGoogle(_testUsername);
     var googleApiClient = new GoogleApiClient(googleAuthenticator.GetCurrentCredentials());
     var bot = BotClient.GetBotClientInstance();
     bot.StartBotClient(googleApiClient.GetEventsUser(), googleApiClient.GetGmailsUser(),
         googleApiClient.GetCurrentUser());
     return bot;
 }
        public async Task InsertedUserToDb()
        {
            var googleAuthenticatorService = new AuthenticationGoogle();
            var userTable = new UsersTable();

            await googleAuthenticatorService.LoginGoogle(_testUsername);
            var user = userTable.GetRow(_testUsername);
            
            Assert.AreEqual(user.name, _testUsername);
        }
        public async Task UpdateSpecificUser()
        {
            var googleAuthenticatorService = new AuthenticationGoogle();
            var userTable = new UsersTable();
            await googleAuthenticatorService.LoginGoogle(_testUsername);
            var user = googleAuthenticatorService.GetCurrentUser();
            userTable.InsertRow(user);
            var updatedUser = AuthenticationGoogle.GetSpecificUser(_testUsername);

            Assert.AreNotEqual(user.expireDate, updatedUser.expireDate);
        }
 private async void LoginGoogle()
 {
     AuthenticationGoogle googleAuthenticationService = new AuthenticationGoogle();
     await googleAuthenticationService.LoginGoogle("user");
 }
 public async Task TestGoogleApiClient()
 {
     var googleAuthenticator = new AuthenticationGoogle();
     await googleAuthenticator.LoginGoogle(_testUsername);
     var googleApiClient = new GoogleApiClient(googleAuthenticator.GetCurrentCredentials());
     var currentUser = googleApiClient.GetCurrentUser();
     Assert.IsNotNull(currentUser);
     Assert.IsNotNull(googleApiClient.GetEventsUser());
     Assert.IsNotNull(googleApiClient.GetGmailsUser());
     Assert.IsNotNull(GoogleApiClient.GetCurrentWeather(currentUser.location));
 }
 public async Task GoogleAuthentication()
 {
     var googleAuthenticatorService = new AuthenticationGoogle();
     await googleAuthenticatorService.LoginGoogle(_testUsername);
     Assert.IsNotNull(googleAuthenticatorService.GetCurrentUser());
 }