Exemplo n.º 1
0
		public void GetLastElement_OneElement()
		{
			IVwLayoutStream stream = VwLayoutStreamClass.Create();
			using (DummyDivisionMgr division = new DummyDivisionMgr(stream, false))
			{
				using (DummyPublication dummyPub = new DummyPublication(null, division, DateTime.Now))
				{
					using (DummyPage page = new DummyPage(dummyPub))
					{
						PageElement element = new PageElement(division, stream, false,
							new Rectangle(720, 1440, (int)(6.5 * 720), (int)(9 * 1440)),
							0, true, 1, 1, 0, 9 * 1440, 0, false);
						page.PageElements.Add(element);

						int xd;
						PageElement lastElement = page.CallGetLastElement(division, out xd);
						Assert.AreEqual(element.LocationOnPage.Right, xd);
						Debug.WriteLine("GetLastElement_OneElement xd: " + xd);

						Assert.AreEqual(element, lastElement);
					}
				}
			}
		}
Exemplo n.º 2
0
		public void GetLastElement_TwoElementsRtoLStandard()
		{
			IVwLayoutStream stream = VwLayoutStreamClass.Create();
			using (DummyDivisionMgr division = new DummyDivisionMgr(stream, true))
			using (DummyPublication dummyPub = new DummyPublication(null, division, DateTime.Now))
			using (DummyPage page = new DummyPage(dummyPub))
			{

				PageElement leftColumnElement = new PageElement(division, stream, false,
					new Rectangle(0, 1440, (int)(3 * 720), (int)(5 * 1440)),
					0, true, 1, 2, 0, 5 * 1440, 0, true);
				PageElement rightColumnElement = new PageElement(division, stream, false,
					new Rectangle(3 * 720 + 360, 1440, (int)(3 * 720), (int)(9 * 1440)),
					0, true, 2, 2, 0, 9 * 1440, 0, true);

				page.PageElements.Add(leftColumnElement);
				page.PageElements.Add(rightColumnElement);

				int xd;
				PageElement lastElement = page.CallGetLastElement(division, out xd);
				Debug.WriteLine("GetLastElement_TwoElementsRtoLStandard xd: " + xd);

				Assert.AreEqual(leftColumnElement, lastElement,
					"The left-most column should be the last element in a right-to-left writing system");
				Assert.AreEqual(0, xd);
			}
		}