Beispiel #1
0
 public virtual void AddStatusItem(Topic statusTopic)
 {
     // validate that the status topic isn't already assigned to the report?
     // otherwise we have more than one status item being assigned which may cause confusion - but also may be limiting
     var si = new StatusItem(statusTopic);
     this.Items.Add(si);
 }
        public void AddStatusItemTest()
        {
            StatusReport target = new StatusReport(); // TODO: Initialize to an appropriate value
            Topic statusTopic = new Topic() {Caption = "Test Topic"}; // TODO: Initialize to an appropriate value
            target.AddStatusItem(statusTopic);
            Assert.AreEqual(1, target.Items.Count);

            StatusItem si = target.Items[0];
            Assert.AreEqual(statusTopic.Caption, si.Caption);
        }
Beispiel #3
0
 public void IdTest()
 {
     Topic target = new Topic(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     target.Id = expected;
     actual = target.Id;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Beispiel #4
0
 public void CaptionTest()
 {
     Topic target = new Topic(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.Caption = expected;
     actual = target.Caption;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Beispiel #5
0
 public StatusItem(Topic statusTopic)
     : this()
 {
     this.Topic = statusTopic;
 }
Beispiel #6
0
 public void TopicConstructorTest()
 {
     Topic target = new Topic();
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Beispiel #7
0
        public void BasicPersistenceTest()
        {
            Assert.IsTrue(true, "RanTestMethod1");
            var factory = _config.CreateSessionFactory();
            using (var session = factory.OpenSession())
            {
                var project = new Project
                {
                    Name = "Test Project 1",
                    StartDate = DateTime.Parse("01/01/2012"),
                    EndDate = DateTime.Parse("07/01/2012"),
                    Description = "Test project description",
                    JiraProject = "TESTPROJ",
                    Team = _team,
                    Type = ProjectType.Grow,
                    Department = _department
                };
                var project2 = new Project
                {
                    Name = "Test Project 2",
                    StartDate = DateTime.Parse("01/01/2012"),
                    EndDate = DateTime.Parse("07/01/2012"),
                    Description = "Test project 2 description",
                    JiraProject = "TESTPROJ2",
                    Team = _team,
                    Type = ProjectType.Grow,
                    Department = _department
                };

                var topic1 = new JiraIssueTopic
                {
                    JiraId = "BOTEST-1",
                    Caption = "This is the caption"
                };
                var topic2 = new JiraProjectTopic
                {
                    JiraProjectId = "PROJ-1",
                    Caption = "Test project"
                };
                var topic3 = new Topic
                {
                    Caption = "Standard topic"
                };
                var status1 = new StatusItem
                {
                    Caption = "Status",
                    Topic = topic1
                };
                var status2 = new StatusItem
                {
                    Topic = topic2
                };
                var status3 = new StatusItem
                {
                    Topic = topic3
                };
                session.Save(project);
                session.Save(project2);
                session.Save(topic1);
                session.Save(topic2);
                session.Save(topic3);
                session.Save(status1);
                session.Save(status2);
                session.Save(status3);
                Assert.AreNotEqual(topic1.Caption, status1.Caption);
                Assert.AreEqual(topic2.Caption, status2.Caption);
                Assert.AreEqual(topic3.Caption, status3.Caption);
                // delete status shouldn't remove topic
                session.Delete(status3);
                var topicRetVal3 = session.Get<Topic>(topic3.Id);
                Assert.IsNotNull(topicRetVal3);
            }

            using (var session2 = factory.OpenSession())
            {
                var project = session2.Get<Project>(1);
                Assert.IsNotNull(project);
                Assert.AreEqual<string>(project.Department.Name, "Operations IT");

                var projects = session2.Query<Project>()
                    .OrderBy(c => c.Name)
                    .ToList();
                Assert.AreEqual(2, projects.Count);

            }
        }