public void createCalendarTest() { CalendarBLL target = new CalendarBLL(); string name = "UnitTestName"; bool expected = true; bool actual; actual = target.createCalendar(name); Assert.AreEqual(expected, actual); }
/*private void populateNewProjectDropDown() { CalendarBLL temp = new CalendarBLL(); NewProjectDropDown.DataSource = temp.getProjectNames(); NewProjectDropDown.DataBind(); }*/ protected void SaveNewCalendar(object sender, EventArgs e) { CalendarBLL calendarBLL = new CalendarBLL(); ArrayList currentCalendars = null; String name = calendarName.Text; if (name == null || name.Length == 0) { TopMostMessageBox.Show("Name cannot be empty", "Error"); return; } if ((currentCalendars = calendarBLL.getCalendars()) != null) { foreach (String n in currentCalendars) { if (name.Equals(n)) { TopMostMessageBox.Show("A calendar with that name already exists.", "Error"); return; } } } /*String projectName = ProjectsDropDown.SelectedValue; if (projectName == null || projectName.Length == 0) { TopMostMessageBox.Show("Project cannot be empty", "Error"); return; }*/ calendarBLL.createCalendar(name); InitPanel.Visible = true; CreatePanel.Visible = false; }