コード例 #1
0
ファイル: test.cs プロジェクト: amir9979/sadna
        public void TestWatchAllThreads() //need to return true only to values
        {
            List <PostInfo> posts = forum.WatchAllThreads(makeTestSubforum(1));

            Assert.AreEqual(3, posts.Count);

            Assert.IsTrue(testPost(posts[0], 1));

            Assert.IsTrue(testPost(posts[1], 2));
            Assert.IsTrue(testPost(posts[2], 3));
        }
コード例 #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            int ind = listBox2.SelectedIndex;

            if (ind >= 0)
            {
                PostInfo p = CurrentState.currentPostInfo;
                myConnection.deletePost(p);
                CurrentState.currentPostInfo = null;
                listBox3.Items.Clear(); listBox2.Items.Clear();
                this.allThreads = myConnection.WatchAllThreads(this.CurrentState.currentSubForumInfo);
                for (int i = 0; i < this.allThreads.Count; i++)
                {
                    listBox2.Items.Add(allThreads.ElementAt(i).msg);
                }
            }
        }