public void HasSymptomsNullFailTest() { var zones = new AppSupportedTimeZones(); var form = new IndexFormProc(_clock, zones.GetTzDbName("GMT"), "en-GB", false); Assert.Equal("This value is required", form.ValidateHasSymptoms(null)); Assert.False(form.IsValid()); }
public void HasSymptomsInvalidFailTest() { var zones = new AppSupportedTimeZones(); var form = new IndexFormProc(_clock, zones.GetTzDbName("GMT"), "en-GB", false); Assert.Equal("Please enter either 'yes' or 'no'", form.ValidateHasSymptoms("gg")); Assert.False(form.IsValid()); }
public void HasSymptomsNoTest() { var zones = new AppSupportedTimeZones(); var form = new IndexFormProc(_clock, zones.GetTzDbName("GMT"), "en-GB", false); var tim = new LocalDateTime(2020, 01, 1, 17, 35, 00).InZoneStrictly(_zoneGmt).ToInstant(); Assert.Null(form.ValidateHasSymptoms("no")); Assert.Null(form.ValidateStartIsolation("01-01-2020 5:35 PM")); Assert.Null(form.ValidateStartSymptoms("01-01-2020 5:35 PM")); Assert.True(form.IsValid()); Assert.False(form.HasSymptoms); Assert.Equal(tim, form.StartIsolation); Assert.Equal(tim, form.StartSymptoms); }