Beispiel #1
0
        public void Launched_LessThanOneSecondUnderWindowToRemove_Should_RemainInList()
        {
            DateTime   almostFiveMinutesAgo = DateTime.Now.Subtract(new TimeSpan(0, 0, 5, 0)).AddMilliseconds(10);
            LaunchInfo li = CreateLaunchInfoWithTime(almostFiveMinutesAgo);

            MockLaunchInfoProvider mock = new MockLaunchInfoProvider();

            mock.LaunchList.Add(li);

            SpaceportDepartureBoard sut = new SpaceportDepartureBoard(mock);

            sut.RemoveInactiveLaunches();

            Assert.AreEqual(1, sut.LaunchList.Count, "Launched less than 5 minutes ago, should still be on the board");
        }
Beispiel #2
0
        public void Launched_ExactlyFiveMinutesAgo_ShouldNot_RemainInList()
        {
            DateTime   exactlyFiveMinutesAgo = DateTime.Now.Subtract(new TimeSpan(0, 5, 0));
            LaunchInfo li = CreateLaunchInfoWithTime(exactlyFiveMinutesAgo);

            MockLaunchInfoProvider mock = new MockLaunchInfoProvider();

            mock.LaunchList.Add(li);

            SpaceportDepartureBoard sut = new SpaceportDepartureBoard(mock);

            sut.RemoveInactiveLaunches();

            Assert.AreEqual(0, sut.LaunchList.Count, "Launched 5 minutes ago, should be removed from list of launches");
        }
Beispiel #3
0
        public void Launched_WellUnderWindowToRemove_Should_RemainInList()
        {
            DateTime   fourMinutesAgo = DateTime.Now.Subtract(new TimeSpan(0, 0, 4, 0));
            LaunchInfo li             = CreateLaunchInfoWithTime(fourMinutesAgo);

            MockLaunchInfoProvider mock = new MockLaunchInfoProvider();

            mock.LaunchList.Add(li);

            SpaceportDepartureBoard sut = new SpaceportDepartureBoard(mock);

            sut.RemoveInactiveLaunches();

            Assert.AreEqual(1, sut.LaunchList.Count, "Launched four minutes ago, should still be on the board");
        }