Exemple #1
0
        public static async Task <ClientSesion> InstanceByLogin(string username, string password)
        {
            var accessApi = new AccessApi(TestConfig.BaseUrl);
            var loginRes  = await accessApi.LoginAsync(new LoginModel(username, password));

            Assert.NotNull(loginRes);
            Assert.NotNull(loginRes.AccessToken);

            var attacher = new AccessTokenAttacher(loginRes.AccessToken);

            attacher.Attach(accessApi);

            // Test me and get id
            var me = await accessApi.MeAsync();

            Assert.NotEqual(default, me.Id);
Exemple #2
0
 public ClientSesion(AccessTokenAttacher accessTokenAttacher, Guid userId)
 {
     AccessTokenAttacher = accessTokenAttacher;
     UserId = userId;
 }