Beispiel #1
0
        public void TestCardCoverage()
        {
            //This is to test to ensure the properties exist; this would not be used in practice
            var sequence = new Sequence()
            {
                ViewMode = ViewMode.Gallery
            };

            sequence.SetDefaults();

            Assert.NotNull(sequence.ToString());
            Assert.NotNull(sequence.ToJson());


            var sequenceNew = new SequenceNew()
            {
                TemplateId = ""
            };

            Assert.NotNull(sequenceNew.TemplateId);
            sequenceNew.SetDefaults();
            Assert.NotNull(sequenceNew.ToJson());
            Assert.NotNull(sequenceNew.ToString());

            var sequencePatch = new SequencePatch().SetDefaults();

            Assert.NotNull(sequencePatch.ToJson());
            Assert.NotNull(sequencePatch.ToString());


            var sequenceUpdate = new SequenceUpdate().SetDefaults();

            Assert.NotNull(sequenceUpdate.ToJson());
            Assert.NotNull(sequenceUpdate.ToString());
        }
Beispiel #2
0
        public async Task TestPatchSequence()
        {
            var assignment   = CreateAssignmentNew();
            var assignmentId = await AssignmentUtils.CreateAssignment(assignment);

            var sequencePatch = new SequencePatch();

            sequencePatch.Add("viewMode", "gallery");
            var patchSequenceRequest = new PatchSequenceRequest(sequencePatch, assignmentId, AssignmentUtils.ROOT_SEQUENCE_ID);
            await SkyManager.ApiClient.ExecuteRequestAsync(patchSequenceRequest); //TODO: If we wanted to do a full integration test, we could get the card and make sure the label has updated

            var getSequenceRequest = new GetSequenceRequest(assignmentId, AssignmentUtils.ROOT_SEQUENCE_ID);

            var getSequenceResponse = await SkyManager.ApiClient.ExecuteRequestAsync(getSequenceRequest);

            var returnedSequence = getSequenceResponse.Content;

            Assert.Equal(SkyManager.IntegrationId, returnedSequence.UpdatedBy);
            Assert.NotNull(returnedSequence.Updated);

            await AssignmentUtils.DeleteAssignment(assignmentId);
        }