public UserSessionManagerTests() { stubSession = new UserSession { UserId = 11, Token = "test_token" }; }
/// <summary> /// Saves session created from userId and accessToken to database. /// </summary> /// <param name="userId">BetterSalesman user identifier in BetterSalesman database (session and business data are stored in separate databases).</param> /// <param name="accessToken">Access token for BetterSalesman service.</param> public void SaveSession(int userId, string accessToken) { if (string.IsNullOrEmpty(accessToken)) { Debug.WriteLine("ERROR! Save session requires accessToken to be non-null. Cancelling saving session."); return; } CurrentSession = new UserSession { UserId = userId, Token = accessToken }; Save(); }