public void SetUp() { _oAuth = Substitute.For <IGitHubOAuth>(); _persister = Substitute.For <IGitHubUserPersister>(); _userName = "******"; _token = "token"; _oAuth.Login().Returns(new GitHubUserCookie() { UserName = _userName, Token = _token }); _user = new GitHubUser(_oAuth, _persister); }
public bool Login() { if (string.IsNullOrWhiteSpace(UserCookie?.Token)) { UserCookie = OAuth.Login(); } if (UserCookie == null) { return(false); } Persister.Save(this); return(true); }