public void OneItemTest()
 {
     var str = new QueryStringBuilder()
         .Add("key1", "1")
         .Build();
     Assert.AreEqual("?key1=1", str);
 }
 public void NullValueTest()
 {
     var str = new QueryStringBuilder()
         .Add("key1", null)
         .Build();
     Assert.AreEqual("?key1=", str);
 }
 public void EscapeUrlTest()
 {
     var str = new QueryStringBuilder()
         .Add("key1", "?&/")
         .Build();
     Assert.AreEqual("?key1=%3F%26%2F", str);
 }
 public void TwoItemsTest()
 {
     var str = new QueryStringBuilder()
         .Add("key1", "1")
         .Add("key2", "2")
         .Build();
     Assert.AreEqual("?key1=1&key2=2", str);
 }
        public void NavigateToThreadListPage(string boardName, int? page)
        {
            string queryString = new QueryStringBuilder()
                .Add(Constants.QueryStringBoard, boardName)
                .Add(Constants.QueryStringPage, page != null ? page.ToString() : null)
                .Build();

            this.Navigate(Constants.ThreadListPageUri + queryString);
        }
        public void NavigateToPostListPage(string boardName, string pageNumber)
        {
            string queryString = new QueryStringBuilder()
                .Add(Constants.QueryStringBoard, boardName)
                .Add(Constants.QueryStringThread, pageNumber)
                .Build();

            this.Navigate(Constants.PostListPageUri + queryString);
        }
        public void NavigateToAddPostPage(string boardName, string threadNumber, string postNumber)
        {
            string queryString = new QueryStringBuilder()
                .Add(Constants.QueryStringBoard, boardName)
                .Add(Constants.QueryStringThread, threadNumber)
                .Add(Constants.QueryStringPost, postNumber)
                .Build();

            this.Navigate(Constants.AddPostPageUri + queryString);
        }
        private void OnImageMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            var vm = (ThreadPostBaseViewModel)this.DataContext;
            if (vm.HasImage)
            {
                string queryString = new QueryStringBuilder()
                    .Add(Constants.QueryStringUri, vm.AttachmentUri)
                    .Build();

                Container.Resolve<PageNavigationService>().Navigate(Constants.ImageBrowserPageUri + queryString);
            }
            else
            {
                var webBrowserTask = new WebBrowserTask() { Uri = new Uri(vm.AttachmentUri) };
                webBrowserTask.Show();
            }
        }
 public void ZeroItemsTest()
 {
     var str = new QueryStringBuilder().Build();
     Assert.AreEqual("?", str);
 }