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);
public ClientSesion(AccessTokenAttacher accessTokenAttacher, Guid userId) { AccessTokenAttacher = accessTokenAttacher; UserId = userId; }