Ejemplo n.º 1
0
        public void SymptomsTest()
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant();

            var fred = new IsolateRecord("Fred", startQuarantine, true);
            var calc = new CalcUk(fred);

            Assert.Equal(Duration.FromDays(10), calc.GetIsolationRemaining(_clock.GetCurrentInstant())); //now same as startQuarantine
        }
Ejemplo n.º 2
0
        public void NowEarlierStartIsolationFailTest()
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant().Plus(Duration.FromHours(3));

            var fred = new IsolateRecord("Fred", startQuarantine, false);
            var calc = new CalcUk(fred);

            Assert.Equal(ExtNodatime.DurationError, calc.GetIsolationRemaining(_clock.GetCurrentInstant())); //now is earlier than start
        }
Ejemplo n.º 3
0
        public void SymptomsFeverAfterStartTest()
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant().Minus(Duration.FromHours(3));
            var startFever      = startQuarantine.Plus(Duration.FromHours(1));

            var fred = new IsolateRecord("Fred", startQuarantine, true, startFever);
            var calc = new CalcUk(fred);

            Assert.Equal(Duration.FromHours((9 * 24) + 22), calc.GetIsolationRemaining(_clock.GetCurrentInstant())); //now 3 hours after startQuarantine and 2 hours after startFever
        }
Ejemplo n.º 4
0
        public void NoSymptomsAtDay14Test()
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant().Minus(Duration.FromDays(14));
            var expected        = Duration.FromTimeSpan(new TimeSpan(0, 0, 0, 0));

            var fred = new IsolateRecord("Fred", startQuarantine, false);
            var calc = new CalcUk(fred);

            Assert.Equal(expected, calc.GetIsolationRemaining(_clock.GetCurrentInstant()));
        }
Ejemplo n.º 5
0
        public void StartFeverEarlierStartIsolationFailTest()
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant().Minus(Duration.FromHours(3));   //3 hours before _clock (now)
            var startFever      = startQuarantine.Minus(Duration.FromHours(1));                                    //1 hour before startQuarantine

            var fred = new IsolateRecord("Fred", startQuarantine, false, startFever);
            var calc = new CalcUk(fred);

            Assert.Equal(ExtNodatime.DurationError, calc.GetIsolationRemaining(_clock.GetCurrentInstant())); //startFever is earlier than startQuarantine
        }
Ejemplo n.º 6
0
        public void SymptomsAtDay14Test() //It could be argued that the self-isolation is complete so fever is irrelevant, but side with caution
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant().Minus(Duration.FromDays(14));
            var startFever      = startQuarantine.Plus(Duration.FromDays(14));
            var expected        = Duration.FromTimeSpan(new TimeSpan(10, 0, 0, 0));

            var fred = new IsolateRecord("Fred", startQuarantine, true, startFever);
            var calc = new CalcUk(fred);

            Assert.Equal(expected, calc.GetIsolationRemaining(_clock.GetCurrentInstant()));
        }
Ejemplo n.º 7
0
        public void SymptomsAtDay0Test()
        {
            var startQuarantine = _localClock.InZoneStrictly(_zoneGmt).ToInstant();
            var startFever      = startQuarantine;
            var expected        = Duration.FromTimeSpan(new TimeSpan(10, 0, 0, 0));

            var fred = new IsolateRecord("Fred", startQuarantine, true, startFever);
            var calc = new CalcUk(fred);

            Assert.Equal(expected, calc.GetIsolationRemaining(_clock.GetCurrentInstant()));
        }