public void TestCreateExternalMessage()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
            service.CreateExternalMessage("http://orng.info", "Test", "Test of create external message", "025693078");
        }
        public void TestCreateReseachProfile()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
            service.CreateResearchProfile(_employeeId);
        }
        public void TestDeleteActivitiesFromDisabledProfiles()
        {
            List <int> peopleToDelete = new ProfilesServices().GetInactiveProfiles();

            System.Diagnostics.Debug.WriteLine("Found " + peopleToDelete.Count + " people to remove from activity stream");
            int             total    = 0;
            List <Activity> killList = null;

            do
            {
                killList = new List <Activity>();
                try
                {
                    IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
                    service.Login(_username, _password, _token);
                    // just do 1000 at a time
                    foreach (Activity act in service.GetProfileActivities((Activity)null, 200))
                    {
                        if (peopleToDelete.Contains(act.ParentId))
                        {
                            killList.Add(act);
                            System.Diagnostics.Debug.WriteLine("Deleting " + act.Id + " : " + act.Message + " for " + act.ParentName);
                        }
                    }
                    ((ChatterSoapService)service).DeleteActivities(killList);
                    System.Diagnostics.Debug.WriteLine("Deleted " + killList.Count + " activities");
                    total += killList.Count;
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine(e);
                }
            } while (killList.Count > 0);
            System.Diagnostics.Debug.WriteLine("Total removed = " + total);
        }
        public void TestCreateActivity()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
            service.Login(_username, _password, _token);

            DateTime dt = new DateTime(2011, 7, 6, 10, 11, 12);
            service.CreateActivity(_userId, null, "Edited their narrative", "Test Activity from ChatterServiceTest.TestCreateActivity:" + dt, dt);
        }
        public void TestGetActivitiesByUser()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
            List <Activity> list = service.GetUserActivities(_userId, 123, 10);

            Assert.AreEqual(10, list.Count);
        }
        public void TestUsersToGroup()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
            string id = service.CreateGroup("Test API Group 3", "This group was created by unit test", _employeeId);

            service.AddUsersToGroup(id, new string[] { "020524930", "027639251" });
        }
        public void TestGetGroup()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
            string id = "0F9Z000000007Zu";

            Salesforce.CollaborationGroup group = service.GetCollaborationGroup(id);
        }
        public void TestCreateActivity()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);

            DateTime dt = new DateTime(2011, 7, 6, 10, 11, 12);

            service.CreateActivity(_userId, null, "Edited their narrative", "Test Activity from ChatterServiceTest.TestCreateActivity:" + dt, dt);
        }
        public void TestCreateActivityUsingApex()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);

            DateTime dt = DateTime.Now;

            service.CreateActivityUsingApex(_userId, null, "Edited their narrative", "Test Activity from 'ChatterServiceTest.TestCreateActivityUsingApex':" + dt, dt);
        }
        public void TestGetUserId()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);

            string id = service.GetUserId(_employeeId);

            Assert.AreEqual(_userId, id);
        }
        public static void CreateActivity(SqlString url, SqlString username, SqlString password, SqlString token, SqlDateTime createdDT, SqlBoolean externalMessage, SqlString employeeId, SqlString actUrl, SqlString actTitle, SqlString actBody)
        {
            IChatterSoapService service = new ChatterSoapService(url.Value);

            service.AllowUntrustedConnection();
            service.Login(username.Value, password.Value, token.Value);

            service.CreateProfileActivity(employeeId.IsNull ? null : employeeId.Value, actUrl.IsNull ? null : actUrl.Value, actTitle.IsNull ? null : actTitle.Value, actBody.IsNull ? null : actBody.Value, createdDT.Value);
            if (externalMessage.IsTrue)
            {
                service.CreateExternalMessage(actUrl.IsNull ? null : actUrl.Value, actTitle.IsNull ? null : actTitle.Value, actBody.IsNull ? null : actBody.Value, employeeId.IsNull ? null : employeeId.Value);
            }
        }
        public void TestGetUserIdByEmptyEmployeeId()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            try {
                string id = service.GetUserId("");
                Assert.Fail("GetUserId method should throw and exception Employee ID is empty string");
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Employee Id is required", ex.Message);
            }
        }
        public void TestCreateProfileActivity()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);

            //DateTime dt = new DateTime(2012, 7, 29, 14, 11, 12);
            DateTime dt = DateTime.Now;

            service.CreateProfileActivity("025693078", null, "Edited their narrative", "Test Activity from 'TestCreateReseachProfile':" + dt, dt);
            //service.CreateProfileActivity("025693078", "Null body test", null, dt);
            //service.CreateProfileActivity(_employeeId, "Edited their narrative", "Test Activity from 'TestCreateReseachProfile':" + dt, dt);
        }
        public void TestCreateGroup()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
            service.CreateGroup("aa1", "This group was created by unit test", _employeeId);
            service.CreateGroup("aa2", "This group was created by\r\nunit test", _employeeId);
            byte   r     = 0x000D;
            byte   n     = 0x000A & 0x000A;
            String two   = "hello" + Convert.ToString(r) + "world" + r + "odd" + r + "" + n + "very" + r + n + "test";
            String three = "hello" + Convert.ToString(r) + Convert.ToString(n) + "world";

            service.CreateGroup("aa3", two, _employeeId);
            service.CreateGroup("aa4", three, _employeeId);
        }
 public void TestCreateGroup()
 {
     IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
     service.Login(_username, _password, _token);
     service.CreateGroup("aa1", "This group was created by unit test", _employeeId);
     service.CreateGroup("aa2", "This group was created by\r\nunit test", _employeeId);
     byte r = 0x000D;
     byte n = 0x000A & 0x000A;
     String two ="hello" + Convert.ToString(r) + "world" + r + "odd" + r + "" + n + "very" + r + n + "test";
     String three ="hello" + Convert.ToString(r) + Convert.ToString(n) + "world";
     service.CreateGroup("aa3", two, _employeeId);
     service.CreateGroup("aa4", three, _employeeId);
 }
        public void TestLogin()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);

            service.Login(_username, _password, _token);
        }
 public void TestCreateReseachProfile()
 {
     IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
     service.Login(_username, _password, _token);
     service.CreateResearchProfile(_employeeId);
 }
 public void TestDeleteActivitiesFromDisabledProfiles()
 {
     List<int> peopleToDelete = new ProfilesServices().GetInactiveProfiles();
     System.Diagnostics.Debug.WriteLine("Found " + peopleToDelete.Count + " people to remove from activity stream");
     int total = 0;
     List<Activity> killList = null;
     do
     {
         killList = new List<Activity>();
         try
         {
             IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
             service.Login(_username, _password, _token);
             // just do 1000 at a time
             foreach (Activity act in service.GetProfileActivities((Activity)null, 200))
             {
                 if (peopleToDelete.Contains(act.ParentId))
                 {
                     killList.Add(act);
                     System.Diagnostics.Debug.WriteLine("Deleting " + act.Id + " : " + act.Message + " for " + act.ParentName);
                 }
             }
             ((ChatterSoapService)service).DeleteActivities(killList);
             System.Diagnostics.Debug.WriteLine("Deleted " + killList.Count + " activities");
             total += killList.Count;
         }
         catch (Exception e)
         {
             System.Diagnostics.Debug.WriteLine(e);
         }
     } while (killList.Count > 0);
     System.Diagnostics.Debug.WriteLine("Total removed = " + total);
 }
 public void TestGetActivitiesByUser()
 {
     IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
     service.Login(_username, _password, _token);
     List<Activity> list = service.GetUserActivities(_userId, 123, 10);
     Assert.AreEqual(10, list.Count);
 }
        public void TestGetGroup()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
            service.Login(_username, _password, _token);
            string id = "0F9Z000000007Zu";

            Salesforce.CollaborationGroup group = service.GetCollaborationGroup(id);
        }
        public void TestGetUserId()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
            service.Login(_username, _password, _token);

            string id = service.GetUserId(_employeeId);
            Assert.AreEqual(_userId, id);
        }
 public void TestGetUserIWithNullEmployeeId()
 {
     IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
     try
     {
         string id = service.GetUserId(null);
         Assert.Fail("GetUserId method should throw and exception Employee ID is null");
     }
     catch (Exception ex)
     {
         Assert.AreEqual("Employee Id is required", ex.Message);
     }
 }
 public void TestLogin()
 {
     IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
     service.Login(_username, _password, _token);
 }
        public void TestUsersToGroup()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
            service.Login(_username, _password, _token);
            string id = service.CreateGroup("Test API Group 3", "This group was created by unit test", _employeeId);

            service.AddUsersToGroup(id, new string[] { "020524930", "027639251" });
        }
        public void TestCreateProfileActivity()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
            service.Login(_username, _password, _token);

            //DateTime dt = new DateTime(2012, 7, 29, 14, 11, 12);
            DateTime dt = DateTime.Now;
            service.CreateProfileActivity("025693078", null, "Edited their narrative", "Test Activity from 'TestCreateReseachProfile':" + dt, dt);
            //service.CreateProfileActivity("025693078", "Null body test", null, dt);
            //service.CreateProfileActivity(_employeeId, "Edited their narrative", "Test Activity from 'TestCreateReseachProfile':" + dt, dt);
        }
 public void TestCreateExternalMessage()
 {
     IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
     service.Login(_username, _password, _token);
     service.CreateExternalMessage("http://orng.info", "Test", "Test of create external message", "025693078");
 }
        public void TestCreateActivityUsingApex()
        {
            IChatterSoapService service = new ChatterService.ChatterSoapService(_url);
            service.Login(_username, _password, _token);

            DateTime dt = DateTime.Now;
            service.CreateActivityUsingApex(_userId, null, "Edited their narrative", "Test Activity from 'ChatterServiceTest.TestCreateActivityUsingApex':" + dt, dt);
        }