Skip to content

Commit 8053388

Browse files
authored
Merge branch 'main' into Remove-Unused-Functionality-ValidationHelperV2
2 parents b0862b9 + 675d3bf commit 8053388

2 files changed

Lines changed: 12 additions & 20 deletions

File tree

docs/user-guides/Local_machine_setup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
- Signed Git commits (if you would like to contribute): \
1212
[Using 1Password](https://developer.1password.com/docs/ssh/git-commit-signing/) is the easiest option if you have it, otherwise use the below link for instructions \
1313
<https://github.com/NHSDigital/software-engineering-quality-framework/blob/main/practices/guides/commit-signing.md>
14+
- Added the git submodule:
15+
`git submodule update --init --recursive`
1416

1517
## Set-up
1618

tests/UnitTests/StaticTests/ValidationHelperTests.cs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public void ValidateNhsNumber_ValidNHNumbers_ReturnsTrue(string nhsNumber)
2020
}
2121

2222
[TestMethod]
23+
[DataRow(null)]
24+
[DataRow("-1234567890")]
25+
[DataRow("1a2b3c4d5e")]
2326
[DataRow("1234567890")]
2427
[DataRow("9876543219")]
2528
[DataRow("123456789")]
@@ -36,39 +39,26 @@ public void ValidateNhsNumber_InvalidNHNumbers_ReturnsFalse(string nhsNumber)
3639
}
3740

3841
[TestMethod]
39-
[DataRow("1990-10-10")]
40-
[DataRow("2002-04-06")]
41-
[DataRow("1997-12-23")]
42-
[DataRow("2010-01-01")]
43-
[DataRow("2005-12-10")]
42+
[DataRow("20000101")] // yyyymmdd
43+
[DataRow("200001")] // yyyymm
44+
[DataRow("2000-01-01")] // yyyy-mm-dd
45+
[DataRow("01/01/2000 12:00:00")] // dd/mm/yyyy hh:mm:ss
46+
[DataRow("2000")] // yyyy
4447
public void ValidatePastDate_ValidPastDate_ReturnsTrue(string pastDate)
4548
{
4649
var result = ValidationHelper.ValidatePastDate(pastDate);
4750

4851
Assert.IsTrue(result);
4952
}
5053

51-
52-
[TestMethod]
53-
[DataRow("1990-10-10")]
54-
[DataRow("2002-04-06")]
55-
[DataRow("1997-12-23")]
56-
[DataRow("2010-01-01")]
57-
[DataRow("2005-12-10")]
58-
public void ValidateDate_ValidDate_ReturnsTrue(string date)
59-
{
60-
var result = ValidationHelper.IsValidDate(date);
61-
62-
Assert.IsTrue(result);
63-
}
64-
6554
[TestMethod]
6655
[DataRow("9999-10-10")]
6756
[DataRow("3034-04-06")]
6857
[DataRow("6060-12-23")]
6958
[DataRow("7070-01-01")]
70-
[DataRow("7070-01-01")]
7159
[DataRow("dfbgdfdggfggg")]
60+
[DataRow("-2000")]
61+
[DataRow(null)]
7262
public void ValidatePastDate_InvalidPastDate_ReturnsFalse(string pastDate)
7363
{
7464
var result = ValidationHelper.ValidatePastDate(pastDate);

0 commit comments

Comments
 (0)