Пример #1
0
        public void SummaryForProjectTest()
        {
            IssueStatus target = new IssueStatus();
            Project project = null;
            TableRow[] actual = target.SummaryForProject(project);
            Assert.AreEqual(actual.Length, 0);

            project = new Project(1, "Test", DateTime.Now.Subtract(TimeSpan.FromDays(5)), DateTime.Now, "Status", "Description", "Category", DateTime.Now);
            actual = target.SummaryForProject(project);
            Assert.AreEqual(actual.Length, 4);
            Assert.AreEqual(actual[2].Cells[1].Text, "0");
            Assert.AreEqual(actual[3].Cells[1].Text, "0");

            project.AddIssue(new Issue());
            Issue issue = new Issue();
            issue.UpdateStatus(Issue.IssueStatus.Resolved, DateTime.Now);
            project.AddIssue(issue);
            actual = target.SummaryForProject(project);
            Assert.AreEqual(actual.Length, 4);
            Assert.AreEqual(actual[2].Cells[1].Text, "1");
            Assert.AreEqual(actual[3].Cells[1].Text, "1");
        }
Пример #2
0
 public void IssueStatusConstructorTest()
 {
     IssueStatus target = new IssueStatus();
     Assert.IsInstanceOfType(target, typeof(IssueStatus));
     Assert.IsInstanceOfType(target, typeof(SummaryBase));
 }