public void TestWatchAllSubForum() //need to return true only to values { List <ForumInfo> forums = forum.WatchAllForums(); Assert.AreEqual(3, forums.Count); Assert.IsTrue(testForum(forums[0], 1)); Assert.IsTrue(testForum(forums[1], 2)); Assert.IsTrue(testForum(forums[2], 3)); }
private void button3_Click(object sender, EventArgs e) { myConnection.BuildForum(textBox1.Text); textBox1.Clear(); listBox1.Items.Clear(); CurrentState.allForum = myConnection.WatchAllForums(); for (int i = 0; i < CurrentState.allForum.Count(); i++) { listBox1.Items.Add(CurrentState.allForum.ElementAt(i).name); } }
private void button5_Click(object sender, EventArgs e) { List <ForumInfo> AllForums = myConnection.WatchAllForums(); for (int i = 0; i < AllForums.Count(); i++) { listBox1.Items.Add(AllForums.ElementAt(i).name); } }
public ManagerPresentation(ForumConnection myConnectionP, CurrentForumState State) { CurrentState = State; this.myConnection = myConnectionP; InitializeComponent(); listBox1.Items.Clear(); this.CurrentState.allForum = myConnection.WatchAllForums(); for (int i = 0; i < this.CurrentState.allForum.Count; i++) { listBox1.Items.Add(this.CurrentState.allForum.ElementAt(i).name); } }
private void button1_Click(object sender, EventArgs e) { int i; string myText = ""; for (i = 0; i < listBox2.Items.Count; i++) { if (listBox2.GetSelected(i)) { myText = (string)listBox2.Items[i]; break; } } if (myConnection.entry(myText)) { List <ForumInfo> ForumInfoList = myConnection.WatchAllForums(); CurrentState.myForum = ForumInfoList.ElementAt(i); panel1.Visible = true; } else { MessageBox.Show("cant connet to " + myText); } }