Syncano.Net.Api.ApiKeySyncanoClient.ClearSession C# (CSharp) Метод

ClearSession() публичный Метод

Clears current Session Id.
public ClearSession ( ) : void
Результат void
        public void ClearSession()
        {
            _syncanoClient.SetSessionContext(null);
        }

Usage Example

        public async Task StartSession_WithAllTimeZones(ApiKeySyncanoClient client)
        {
            //given
            var timeZones = TimeZoneInfo.GetSystemTimeZones();
            var sessionIds = new List<string>();

            //when
            foreach (var timeZoneInfo in timeZones)
            {
                try
                {
                    sessionIds.Add(await client.StartSession(timeZoneInfo));
                    client.ClearSession();
                    
                }
                catch(ArgumentException)
                { }

            }

            //then
            foreach (var sessionId in sessionIds)
            {
                sessionId.ShouldNotBeNull();
            }
        }