public async Task SfdcConnectionTestAndVersionParametersAwaitAsync() { SfdcConnection conn = new SfdcConnection(true, 36); conn.Username = username; conn.Password = password; conn.Token = token; CancellationToken cancelToken = new CancellationToken(); await conn.OpenAsync(cancelToken); int i = 0; while (conn.State == ConnectionState.Connecting && i < 60) { Thread.Sleep(1000); i++; } Assert.IsTrue(conn.State == ConnectionState.Open); conn.Close(); Assert.IsTrue(conn.State == ConnectionState.Closed); }
public void SfdcConnectionUriParameterAsyncSpecifyFunction() { SfdcConnection conn = new SfdcConnection(string.Format("https://test.salesforce.com/services/Soap/u/{0}.0", 36)); conn.Username = username; conn.Password = password; conn.Token = token; conn.customLoginCompleted += Conn_loginCompleted; conn.OpenAsync(); int i = 0; while (conn.State == ConnectionState.Connecting && i < 60) { Thread.Sleep(1000); i++; } Assert.IsTrue(conn.State == ConnectionState.Open); conn.Close(); Assert.IsTrue(conn.State == ConnectionState.Closed); }
public void SfdcConnectionNoParametersAsync() { SfdcConnection conn = new SfdcConnection(); conn.Username = username; conn.Password = password; conn.Token = token; try { conn.OpenAsync(); } catch { Assert.Fail(); } Assert.IsTrue(true); }
public async Task SfdcConnectionNoParametersAwaitAsync() { SfdcConnection conn = new SfdcConnection(); conn.Username = username; conn.Password = password; conn.Token = token; try { await conn.OpenAsync(default(CancellationToken)); } catch { Assert.Fail(); } Assert.IsTrue(true); }
public async Task SfdcConnectionUriParameterAwaitAsync() { SfdcConnection conn = new SfdcConnection(string.Format("https://test.salesforce.com/services/Soap/u/{0}.0", 36)); conn.Username = username; conn.Password = password; conn.Token = token; await conn.OpenAsync(default(CancellationToken)); int i = 0; while (conn.State == ConnectionState.Connecting && i < 60) { Thread.Sleep(1000); i++; } Assert.IsTrue(conn.State == ConnectionState.Open); conn.Close(); Assert.IsTrue(conn.State == ConnectionState.Closed); }