Esempio n. 1
0
        public void ShouldNotGetDoneDateWhenMovedBackFromDone()
        {
            var jiraStates = new List <JiraState>()
            {
                new JiraState(new DateTime(2020, 10, 7), "DOING", "DONE"),
                new JiraState(new DateTime(2020, 10, 8), "DONE", "DOING")
            };

            var testIssue = new JiraIssue("TEST_KEY", "DESCRIPTION")
            {
                JiraStates = jiraStates,
                Type       = "TEST_TYPE",
                Status     = "DOING"
            };

            var target = IssueTimeInStateMapper.GetDoneDate(testIssue, _mockWorkflowMap);

            Assert.AreEqual(DateTime.MinValue, target);
        }
Esempio n. 2
0
        public void ShouldGetLastDoneDate()
        {
            var jiraStates = new List <JiraState>()
            {
                new JiraState(new DateTime(2020, 10, 7), "DOING", "DONE"),
                new JiraState(new DateTime(2020, 10, 8), "DONE", "TO_DO"),
                new JiraState(new DateTime(2020, 10, 9), "TO_DO", "DOING"),
                new JiraState(new DateTime(2020, 10, 10), "DOING", "DONE")
            };

            var testIssue = new JiraIssue("TEST_KEY", "DESCRIPTION")
            {
                JiraStates = jiraStates,
                Type       = "TEST_TYPE",
                Status     = "DONE"
            };

            var target = IssueTimeInStateMapper.GetDoneDate(testIssue, _mockWorkflowMap);

            Assert.AreEqual(new DateTime(2020, 10, 10), target);
        }