Ejemplo n.º 1
0
        private void CreateTestActivities()
        {
            var activity1 = GetActivityDetail(done: true, tags: "blue");
            var activity2 = GetActivityDetail(ownerEmail: TestConfig.TestUser, tags: "blue, red");
            var activity3 = GetActivityDetail(type: "Task");
            var activity4 = GetActivityDetail(attachedToId: _saleInvoiceTranId2, due: DateTime.Now.AddDays(1), tags: "yellow");
            var activity5 = GetActivityDetail(attachedToId: _saleInvoiceTranId2, due: DateTime.Now.AddDays(1), tags: "orange");

            var activityProxy = new ActivityProxy();

            var response = activityProxy.InsertActivity(activity1);

            _testActivityId1 = response.DataObject.InsertedEntityId;

            response         = activityProxy.InsertActivity(activity2);
            _testActivityId2 = response.DataObject.InsertedEntityId;

            response = activityProxy.InsertActivity(activity3);
            _testActivityToBeDeletedId = response.DataObject.InsertedEntityId;

            response = activityProxy.InsertActivity(activity4);

            response = activityProxy.InsertActivity(activity4);
            _testActivityToBeUpdated = response.DataObject.InsertedEntityId;
        }
Ejemplo n.º 2
0
        public void InsertActivity()
        {
            var uniqueId = Guid.NewGuid().ToString().Substring(0, 5);
            var title    = "Test activity " + uniqueId;
            var details  = "Details of test activity " + uniqueId;
            var tag      = "tag_" + uniqueId;

            var activity = GetActivityDetail(title: title, details: details, tags: tag, ownerEmail: TestConfig.TestUser, done: true, due: DateTime.Now.AddDays(10));
            var proxy    = new ActivityProxy();
            var response = proxy.InsertActivity(activity);

            Assert.True(response.IsSuccessfull, "Call to InsertActivity was not successful");
            Assert.NotNull(response.DataObject);
            Assert.True(response.DataObject.InsertedEntityId > 0, "Call to InsertActivity returned 0 entity Id");

            var activityGet = proxy.GetActivity(response.DataObject.InsertedEntityId);

            Assert.True(activityGet.DataObject != null, "No row returned from Get after insert.");

            VerifyDetailsAreSame(activity, activityGet.DataObject);
            Assert.True(activityGet.DataObject.CreatedDateUtc > DateTime.UtcNow.AddHours(-1) && activityGet.DataObject.CreatedDateUtc < DateTime.UtcNow.AddHours(1));
            Assert.True(activityGet.DataObject.LastModifiedDateUtc > DateTime.UtcNow.AddHours(-1) && activityGet.DataObject.LastModifiedDateUtc < DateTime.UtcNow.AddHours(1));
        }