Exemplo n.º 1
0
        public void CanGetDossierDocuments()
        {
            // Arrange
            Request dossierDocumentsReq = Session.Bind(DossierDocumentsTemplate, new { id = 8 });

            // Act
            DossierDocumentList documents = dossierDocumentsReq.Get <DossierDocumentList>().Body;

            // Assert
            Assert.IsNotNull(documents);
            Assert.AreEqual(2, documents.Count);
        }
Exemplo n.º 2
0
        public void CanFollowLinksInGeneral()
        {
            // Arrange
            Request dossierReq = Session.Bind(DossierTemplate, new { id = 8 });
            Dossier dossier    = dossierReq.Get <Dossier>().Body;

            // Act
            DossierDocumentList documents1 = dossier.Links.Select(CMSConstants.DocumentsLinkRelType).Follow(Session).Get <DossierDocumentList>().Body;

            // Assert
            Assert.IsNotNull(documents1);
            Assert.AreEqual(2, documents1.Count);
        }
Exemplo n.º 3
0
        public void CanFollowRelativeLinksInContextDependentData()
        {
            // Arrange
            Request dossierReq = Session.Bind(DossierTemplate, new { id = 8 });
            Dossier dossier    = dossierReq.Get <Dossier>().Body;

            // Act
            Request             documentsReq = dossier.Links.Select(CMSConstants.DocumentsLinkRelType).Follow();
            DossierDocumentList documents    = documentsReq.Get <DossierDocumentList>().Body;

            // Assert
            Assert.IsNotNull(documents);
            Assert.AreEqual(2, documents.Count);
        }
Exemplo n.º 4
0
        public void FollowCanSelectLinkByItselfWithoutUsingSession()
        {
            // Arrange
            Request dossierReq = Session.Bind(DossierTemplate, new { id = 8 });

            using (var r = dossierReq.Get <Dossier>())
            {
                // Act
                using (var r2 = r.Body.Links.Follow(CMSConstants.DocumentsLinkRelType).Get <DossierDocumentList>())
                {
                    DossierDocumentList documents1 = r2.Body;

                    // Assert
                    Assert.IsNotNull(documents1);
                    Assert.AreEqual(2, documents1.Count);
                }
            }
        }