Esempio n. 1
0
        public void SetUp()
        {
            string serverUrl = "http://namtest2-web.dynamic.ps.porters.local";
            PrivateServerSettings settings = new PrivateServerSettings();

            settings.ServerUrl = new Uri(serverUrl);
            client             = PrivateClient.CreateClient(settings);
            session            = client.CreateSession(PrivateAuthentication.WithCredentials("TestCompany", "*****@*****.**", "password"));
            Assume.That(session.Authenticate(), Is.True, "Cannot login to the server!");
        }
        public void TestPrivateAuthenticationSuccess()
        {
            PrivateClient client = PrivateClient.CreateClient(new PrivateServerSettings {
                ServerUrl = new Uri("http://arwyntest-web.dynamic.ps.porters.local")
            });

            using (PrivateSession session = client.CreateSession(PrivateAuthentication.WithCredentials("TestCompany", "*****@*****.**", "password")))
            {
                var result = session.Call(MetaDataRequest.LastUpdated(1));
                Assert.That(result.LastUpdateDate, Is.GreaterThan(0));
            }
        }
            public async Task RetrievesData()
            {
                PrivateClient client = PrivateClient.CreateClient(new PrivateServerSettings {
                    ServerUrl = new Uri("http://arwyntest-web.dynamic.ps.porters.local")
                });

                using (PrivateSession session = client.CreateSession(PrivateAuthentication.WithCredentials("TestCompany", "*****@*****.**", "password")))
                {
                    var request = ResourceRequest.GetRecords(ResourceId.Process)
                                  .WithFields(FieldCollection.Builder()
                                              .Append("Process.P_PhaseMemo".ToField())
                                              .Build())
                                  .WithRecords(10003);
                    var result = await session.CallAsync(request);

                    Assert.That(result.RecordData.Count, Is.EqualTo(1));
                    Assert.That(result.RecordData.First().Version, Is.EqualTo(1));
                    Assert.That(result.RecordData.First().Count, Is.EqualTo(2));
                    Assert.That(result.RecordData.First().RecordId, Is.EqualTo(10003));
                    Assert.That(result.RecordData.First()["Process.P_PhaseMemo".ToField()], Is.EqualTo("サンプル選考プロセスメモ"));
                }
            }