Пример #1
0
 private void AssertAction(ActionDto actionDto, Action action)
 {
     Assert.AreEqual(action.Id, actionDto.Id);
     Assert.AreEqual(action.IsOverDue(), actionDto.IsOverDue);
     Assert.AreEqual(action.Title, actionDto.Title);
     Assert.AreEqual(action.IsClosed, actionDto.IsClosed);
     Assert.AreEqual(action.DueTimeUtc, actionDto.DueTimeUtc);
     Assert.AreEqual(action.Attachments.Count, actionDto.AttachmentCount);
 }
Пример #2
0
        public void IsOverDue_ShouldBeFalseWhenDueDateInFuture()
        {
            // Arrange
            _dut = new Action(TestPlant, "TitleA", "DescA", _utcNow.AddHours(1));

            // Act
            var overDue = _dut.IsOverDue();

            // Assert
            Assert.IsFalse(overDue);
        }
Пример #3
0
        public void IsOverDue_ShouldBeFalseWhenDueDateExactNow()
        {
            // Arrange
            _dut = new Action(TestPlant, "TitleA", "DescA", _utcNow);

            // Act
            var overDue = _dut.IsOverDue();

            // Assert
            Assert.IsFalse(overDue);
        }
Пример #4
0
        public void IsOverDue_ShouldBeTrueWhenDueDateInPast()
        {
            // Arrange
            _dut = new Action(TestPlant, "TitleA", "DescA", _utcNow);
            _timeProvider.Elapse(new TimeSpan(1, 0, 0));

            // Act
            var overDue = _dut.IsOverDue();

            // Assert
            Assert.IsTrue(overDue);
        }
Пример #5
0
        public void IsOverDue_ShouldBeFalseWhenDueDateInPast_ButClosed()
        {
            // Arrange
            _dut = new Action(TestPlant, "TitleA", "DescA", _utcNow);
            _timeProvider.Elapse(new TimeSpan(1, 0, 0));
            _dut.Close(_utcNow, _personMock.Object);

            // Act
            var overDue = _dut.IsOverDue();

            // Assert
            Assert.IsFalse(overDue);
        }
Пример #6
0
 private void AssertAction(ActionDto actionDto, Action action, PCSPlant plant, Project project)
 {
     AssertEqualAndNotNull(plant.Id, actionDto.PlantId);
     AssertEqualAndNotNull(plant.Title, actionDto.PlantTitle);
     AssertEqualAndNotNull(project.Name, actionDto.ProjectName);
     AssertEqualAndNotNull(project.Description, actionDto.ProjectDescription);
     Assert.AreEqual(project.IsClosed, actionDto.ProjectIsClosed);
     AssertEqualAndNotNull(action.Id, actionDto.Id);
     Assert.AreEqual(action.IsOverDue(), actionDto.IsOverDue);
     AssertEqualAndNotNull(action.Title, actionDto.Title);
     AssertEqualAndNotNull(action.Description, actionDto.Description);
     Assert.AreEqual(action.IsClosed, actionDto.IsClosed);
     Assert.AreEqual(action.DueTimeUtc, actionDto.DueTimeUtc);
     AssertEqualAndNotNull(action.Attachments.Count, actionDto.AttachmentCount);
 }