public void GoBackTo_Exception_IfPageNameIsEmpty()
        {
            MockNavigationStack navigationStack = new MockNavigationStack();

            var e = Assert.Throws<ArgumentException>(() => navigationStack.GoBackTo(""));

            Assert.Equal("The argument cannot be null or an empty string.\r\nParameter name: pageName", e.Message);
            Assert.Equal("pageName", e.ParamName);
        }
        public void GoBackTo_NavigatesBackToPage()
        {
            MockNavigationStack navigationStack = new MockNavigationStack();
            navigationStack.NavigateTo("Page 1");
            navigationStack.NavigateTo("Page 2");
            navigationStack.NavigateTo("Page 3");
            navigationStack.NavigateTo("Page 4");

            navigationStack.GoBackTo("Page 2");

            Assert.Equal(new string[] { "Page 1", "Page 2" }, navigationStack.Select(e => e.PageName).ToList());
        }