コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: seanfifepep/SfdcConnect
        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);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: seanfifepep/SfdcConnect
        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);
        }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: seanfifepep/SfdcConnect
        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);
        }
コード例 #4
0
ファイル: UnitTest1.cs プロジェクト: seanfifepep/SfdcConnect
        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);
        }
コード例 #5
0
ファイル: UnitTest1.cs プロジェクト: seanfifepep/SfdcConnect
        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);
        }