Esempio n. 1
0
        public void AddLinkToHistory()
        {
            //Arrange
            var linkHistory = new LinkHistory();

            //Act
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/")});

            //Assert
            Assert.AreEqual("http://example.org/", linkHistory.CurrentLocation.Target.AbsoluteUri);
        }
Esempio n. 2
0
        public void SupportsOnly10Links()
        {
            //Arrange
            var linkHistory = new LinkHistory();

            //Act
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/1")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/2")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/3")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/4")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/5")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/6")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/7")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/8")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/9")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/10")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/11")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/12")});
            linkHistory.AddToHistory(new Link() { Target = new Uri("http://example.org/13")});

            //Assert
            Assert.AreEqual( 10, linkHistory.Count());
            Assert.AreEqual("http://example.org/13", linkHistory.CurrentLocation.Target.AbsoluteUri);
        }