示例#1
0
        public void ItCreatesNewPages()
        {
            var pd = new CharacterPageDirectory(10, 10);

            var page1 = pd.GetOrCreatePage(0, 15);

            Assert.IsNotNull(page1);
            Assert.AreEqual(2, page1.PageNumber);

            var page2 = pd.GetOrCreatePage(0, 51);

            Assert.IsNotNull(page2);
            Assert.AreEqual(6, page2.PageNumber);

            Assert.AreEqual(6, pd.PageCount);
        }
示例#2
0
        public void PageCoordinatesAndPositionsMatch()
        {
            var pd = new CharacterPageDirectory(80, 60);

            pd[0, 60] = new Character(new Text(null, null), 0, 0xFF, null, CharacterFlags.None);

            Assert.AreEqual(2, pd.GetOrCreatePage(60 * 80).PageNumber);
            Assert.AreEqual(0xFF, pd.Get(1)[0].Char);
            Assert.AreEqual(0xFF, pd[60 * 80].Char);
        }
示例#3
0
        public void ItRetrievesInitialPage()
        {
            var pd = new CharacterPageDirectory(100, 100);

            var page = pd.GetOrCreatePage(0, 0);

            Assert.IsNotNull(page);
            Assert.AreEqual(1, page.PageNumber);
            Assert.AreEqual(100, page.Columns);
            Assert.AreEqual(100, page.Rows);
        }