예제 #1
0
        public void GetActivitiesFilterOnTagsRequireAll()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(tags: "red, blue", tagFilterType: "requireAll");

            Assert.True(response.IsSuccessfull, "Call to GetActivitiesFilterOnTagsRequireAny was not successful");
            Assert.NotNull(response.DataObject);
            Assert.Null(response.DataObject.Activities.FirstOrDefault(a => !a.Tags.Contains("red") || !a.Tags.Contains("blue")));
        }
예제 #2
0
        public void GetActivitiesFilterAttachedToTypeAndAttachedToId()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(attachedToType: "sale", attachedToId: _saleInvoiceTranId2);

            Assert.True(response.IsSuccessfull, "Call to GetActivitiesFilterAttachedToTypeAndAttachedToId was not successful");
            Assert.NotNull(response.DataObject);
            Assert.Null(response.DataObject.Activities.FirstOrDefault(a => a.AttachedToType.ToLower() != "sale" && a.AttachedToId != _saleInvoiceTranId2));
        }
예제 #3
0
        public void GetActivitiesFilterFromAndToDate()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(fromDate: DateTime.Now.AddDays(-1), toDate: DateTime.Now.AddDays(-1));

            Assert.True(response.IsSuccessfull, "Call to GetActivitiesFilterFromAndToDate was not successful");
            Assert.NotNull(response.DataObject);
            Assert.Null(response.DataObject.Activities.FirstOrDefault(a => a.Due != DateTime.Now.AddDays(-1)));
        }
예제 #4
0
        public void GetActivitiesFilterOwnerEmail()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(ownerEmail: TestConfig.TestUser);

            Assert.True(response.IsSuccessfull, "Call to GetActivitiesFilterOwnerEmail was not successful");
            Assert.NotNull(response.DataObject);
            Assert.Null(response.DataObject.Activities.FirstOrDefault(a => a.OwnerEmail != TestConfig.TestUser));
        }
예제 #5
0
        public void GetActivitiesFilterOnStatus()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(activityStatus: "done");

            Assert.True(response.IsSuccessfull, "Call to GetActivitiesFilterOnStatus was not successful");
            Assert.NotNull(response.DataObject);
            Assert.Null(response.DataObject.Activities.FirstOrDefault(a => !a.Done));
        }
예제 #6
0
        public void GetActivitiesFilterOnType()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(activityType: "Task");

            Assert.True(response.IsSuccessfull, "Call to GetActivities was not successful");
            Assert.NotNull(response.DataObject);
            Assert.Null(response.DataObject.Activities.FirstOrDefault(a => a.ActivityType != "Task"));
        }
예제 #7
0
        public void GetActivities()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities();

            Assert.True(response.IsSuccessfull, "Call to GetActivities was not successful");
            Assert.NotNull(response.DataObject);
            Assert.True(response.DataObject.Activities.Count > 1, "Call to GetActivities returned too few rows");
        }
예제 #8
0
        public void GetActivitiesFilterOnTagsExcludeAny()
        {
            var proxy    = new ActivitiesProxy();
            var response = proxy.GetActivities(tags: "red, blue", tagFilterType: "excludeAny");

            Assert.IsTrue(response.IsSuccessfull, "Call to GetActivitiesFilterOnTagsExcludeAny was not successful");
            Assert.IsNotNull(response.DataObject, "Call to GetActivitiesFilterOnTagsExcludeAny returned no data");
            Assert.IsNull(response.DataObject.Activities.Where(a => a.Tags.Contains("red") || a.Tags.Contains("blue")).FirstOrDefault());
        }