Ejemplo n.º 1
0
        public void GenericContent_KeepIconAfterUndocheckout()
        {
            Page samplePage = new Page(TestRoot);

            samplePage.Name = "SamplePage";

            //set index
            string icon = "icon.ic";
            samplePage.Icon = icon;

            samplePage.Save();
            samplePage.CheckOut();
            samplePage.UndoCheckOut();

            //asserts
            Assert.AreEqual(icon, samplePage.Icon, "Icon property doesn't contain the expected value.");

        }
Ejemplo n.º 2
0
        public void GenericContent_KeepBinaryAfterPublish()
        {
            Page samplePage = new Page(TestRoot);
            
            samplePage.Name = "SamplePage";
            samplePage.VersioningMode = ContentRepository.Versioning.VersioningType.MajorAndMinor;
            samplePage.ApprovingMode = ContentRepository.Versioning.ApprovingType.True;
            
            //set binaries
            BinaryData pageBinaryData = CreateBinaryDataFromString("Page Binary");
            BinaryData psBinaryData = CreateBinaryDataFromString("Page PersonalizationSettings");

            samplePage.Binary = pageBinaryData;
            samplePage.PersonalizationSettings = psBinaryData;

            //save page
            samplePage.Save();
            samplePage.CheckOut();
            samplePage.Publish();

            //asserts
            //TODO: CheckBinariesInPageByString hosszutavon folosleges
            CheckBinariesInPageByString(samplePage, "Page Binary", "Page PersonalizationSettings");
            CheckBinariesInPageByByte(samplePage,pageBinaryData.GetStream(),psBinaryData.GetStream());
            
        }
Ejemplo n.º 3
0
        public void GenericContent_KeepIndexAfterUndocheckout()
        {
            Page samplePage = new Page(TestRoot);

            samplePage.Name = "SamplePage";

            //set index
            int index = 15;
            samplePage.Index = index;

            samplePage.Save();
            samplePage.CheckOut();
            samplePage.UndoCheckOut();

            //asserts
            Assert.AreEqual(index, samplePage.Index, "Index property doesn't contain the expected value.");

        }
Ejemplo n.º 4
0
        public void GenericContent_KeepTextPropertyAfterUndocheckout()
        {
            Page samplePage = new Page(TestRoot);

            samplePage.Name = "SamplePage";

            //set sample page
            string textProperty = "minta property";
            samplePage.Keywords = textProperty;

            samplePage.Save();
            samplePage.CheckOut();
            samplePage.UndoCheckOut();

            //asserts
            Assert.AreEqual(textProperty, samplePage.Keywords, "Keywords property doesn't contain the expected strings.");

        }
Ejemplo n.º 5
0
        public void GenericContent_KeepReferenceAfterUndocheckout()
        {
            //create page template
            PageTemplate samplePageTemplate = new PageTemplate(TestRoot);
            samplePageTemplate.Name = "Sample Page Template";
            samplePageTemplate.Binary = CreateBinaryDataFromString("<html><head></head><body></body></html>");
            samplePageTemplate.Save();

            Page samplePage = new Page(TestRoot);

            samplePage.Name = "SamplePage";

            //set reference
            samplePage.PageTemplateNode = samplePageTemplate;

            samplePage.Save();
            samplePage.CheckOut();
            samplePage.UndoCheckOut();

            //asserts
            CheckPageTemplateInPage(samplePage, samplePageTemplate.Id);

        }
Ejemplo n.º 6
0
        public void GenericContent_KeepBinaryAfterUndocheckout()
        {
            Page samplePage = new Page(TestRoot);

            samplePage.Name = "SamplePage";

            //set binaries
            BinaryData pageBinaryData = CreateBinaryDataFromString("Page Binary");
            BinaryData psBinaryData = CreateBinaryDataFromString("Page PersonalizationSettings");

            samplePage.Binary = pageBinaryData;
            samplePage.PersonalizationSettings = psBinaryData;

            //save page
            samplePage.Save();
            samplePage.CheckOut();
            samplePage.UndoCheckOut();

            //asserts
            //TODO: CheckBinariesInPageByString hosszutavon folosleges
            CheckBinariesInPageByString(samplePage, "Page Binary", "Page PersonalizationSettings");
            CheckBinariesInPageByByte(samplePage, pageBinaryData.GetStream(), psBinaryData.GetStream());

        }
Ejemplo n.º 7
0
		public void Storage2_Bug_PageCheckin()
		{
            //Assert.Inconclusive("Approving off, None: CheckedOut ==> Publish");

            var binData1 = "PageBinaryData_original";
			var persData1 = "PersonalizationSettingsBinaryData_original";
			var binData2 = "PageBinaryData_edited";
			var persData2 = "PersonalizationSettingsBinaryData_edited";

			var page = new Page(TestRoot);
			page.Name = "TestPage";

			page.Binary = new BinaryData() { ContentType = "text/plain", FileName = "a.aspx" };
			page.PersonalizationSettings = new BinaryData() { ContentType = "text/plain", FileName = "a.PersonalizationSettings" };
			page.Binary.SetStream(Tools.GetStreamFromString(binData1));
			page.PersonalizationSettings.SetStream(Tools.GetStreamFromString(persData1));

			page.Save();
			var pageId = page.Id;

			page.CheckOut();

			page = Node.Load<Page>(pageId);
			page.Binary.SetStream(Tools.GetStreamFromString(binData2 + "bad"));
			page.PersonalizationSettings.SetStream(Tools.GetStreamFromString(persData2 + "bad"));
			page.Save();

			page = Node.Load<Page>(pageId);
			page.Binary.SetStream(Tools.GetStreamFromString(binData2));
			page.PersonalizationSettings.SetStream(Tools.GetStreamFromString(persData2));
			page.Save();

			page.CheckIn();

			page = Node.Load<Page>(pageId);
			var bin = Tools.GetStreamString(page.Binary.GetStream());
			var pers = Tools.GetStreamString(page.PersonalizationSettings.GetStream());

			Assert.IsTrue(bin == binData2, "#1");
			Assert.IsTrue(pers == persData2, "#2");
		}