Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Commit e5d324d

Browse files
Please geen errors moren, please
1 parent 65759f3 commit e5d324d

8 files changed

+52
-4
lines changed

ViewModel.Test/ViewModel_Decisiontree_Method_Interest.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,12 @@ public void CheckOfInterestAreClose_False()
106106
var result = Helpers.Decisiontree.Methodes.InterestCheck.CheckInterest(list1, list2);
107107
Assert.False(result);
108108
}
109+
[Test]
110+
public void CheckOfInterstCanBeNull()
111+
{
112+
List<Interest> list1 = new List<Interest>();
113+
var result = Helpers.Decisiontree.Methodes.InterestCheck.CheckInterest(null, list1);
114+
Assert.False(result);
115+
}
109116
}
110117
}

ViewModel.Test/ViewModel_Decisiontree_Method_MoralCheck.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,12 @@ public void CheckOfMoralAreClose_False()
105105
var result = Helpers.Decisiontree.Methodes.MoralCheck.CheckMoral(list1, list2);
106106
Assert.False(result);
107107
}
108+
[Test]
109+
public void CheckOfMoralCanBeNull()
110+
{
111+
List<Moral> list2 = new List<Moral>();
112+
var result = Helpers.Decisiontree.Methodes.MoralCheck.CheckMoral(null, list2);
113+
Assert.False(result);
114+
}
108115
}
109116
}

ViewModel.Test/ViewModel_Decisiontree_Method_SameSchool.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,13 @@ public void CheckOfSchoolAreSame_false()
3232
var result = Helpers.Decisiontree.Methodes.SameSchoolCheck.CheckSameSchool(school1, school2);
3333
Assert.False(result);
3434
}
35+
36+
[Test]
37+
public void CheckOfSchoolCanBeNull()
38+
{
39+
var school1 = new School(1, "Windesheim", "Zwolle", "Verf");
40+
var result = Helpers.Decisiontree.Methodes.SameSchoolCheck.CheckSameSchool(null, school1);
41+
Assert.False(result);
42+
}
3543
}
3644
}

ViewModel.Test/ViewModel_Decisiontree_method_CheckMoralPercentage.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@ public void CheckOfMoralAreClose_false()
4646
Assert.False(result);
4747
}
4848

49+
[Test]
50+
public void CheckOfMoralCanBeNull()
51+
{
52+
List<Moral> list1 = new List<Moral>();
53+
var result = Helpers.Decisiontree.Methodes.MoralPercentageCheck.CheckMoralPercentage(null, list1);
54+
Assert.False(result);
55+
}
56+
4957
}
5058
}

ViewModel.Test/ViewModel_Method_Decisiontree_SameAge.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@ public void CheckOfAgeAreSame_false()
3535
var result = Helpers.Decisiontree.Methodes.SameAgeCheck.CheckSameAge(pf1, pf2);
3636
Assert.False(result);
3737
}
38+
39+
[Test]
40+
public void CheckOfAgeCanBeNull()
41+
{
42+
var pf2 = new Profile() { Age = "12 jaar" };
43+
var pf1 = new Profile();
44+
var result = Helpers.Decisiontree.Methodes.SameAgeCheck.CheckSameAge(pf1, pf2);
45+
Assert.False(result);
46+
}
3847
}
3948
}

ViewModel.Test/ViewModel_Method_Decisiontree_SameCity.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@ public void CheckOfCityAreSame_false()
3535
var result = Helpers.Decisiontree.Methodes.SameCityCheck.CheckSameCity(pf1, pf2);
3636
Assert.False(result);
3737
}
38+
39+
[Test]
40+
public void CheckOfCityCanBeNull()
41+
{
42+
var pf2 = new Profile() { City = "Rotterdam" };
43+
var pf1 = new Profile();
44+
var result = Helpers.Decisiontree.Methodes.SameCityCheck.CheckSameCity(pf1, pf2);
45+
Assert.False(result);
46+
}
3847
}
3948
}

ViewModel/Helpers/Decisiontree/Methodes/SameAgeCheck.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public static bool CheckSameAge(Profile pf, Profile liupf)
3434
/// <returns>true or false</returns>
3535
private static bool CheckAge(Profile pf, Profile liupf)
3636
{
37-
if (pf.Age == null || pf.Age == "")
37+
if (String.IsNullOrEmpty(pf.Age))
3838
{
39-
pf.Age = "00";
39+
return false;
4040
}
4141

4242
try

ViewModel/Helpers/Decisiontree/Methodes/SameCityCheck.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public static class SameCityCheck
1515
/// <returns>true if they live is the same city and add 5 points to overall score, false if not in the same city</returns>
1616
public static bool CheckSameCity(Profile pf, Profile lipf)
1717
{
18-
19-
if (pf.City == null || pf.City == "")
18+
19+
if (String.IsNullOrEmpty(pf.City))
2020
{
2121
return false;
2222
}

0 commit comments

Comments
 (0)