I have built a class called “MemoryDB” (whose c’tor takes 6 arguments) and created unit-test for her.
Everything was OK until today – I tried deleting one of the arguments, so they remain 5. Even though (after re-building, saving, re-creating the class MemoryDB, etc.), the unit-test does not recognize the change and the error message appears: TimeTable.DB.MemoryDB does not contain a constructor that takes 5 arguments.
I also tried to re-create the unit-test, but for some reason the automatic c’tor it creates is the old c’tor, with 6 arguments.
Have I deleted the argument in a wrong way? How can I fix this? Do other errors in the project might cause this weird problem?
p.s. here is the old c’tor:
public MemoryDB(List<Grade> allGrades, List<Teacher> allTeachers, ForbiddenHours forbiddenHours, List<Group> allGroups, List<List<Teacher>> staffs, List<List<Group>> parallelGroups)
{
CheckParametersValidation(allGrades, allTeachers, forbiddenHours, allGroups, staffs, parallelGroups);
this.allGrades = allGrades;
this.allTeachers = allTeachers;
this.forbiddenHours = forbiddenHours;
this.allGroups = allGroups;
this.staffs = staffs;
this.parallelGroups = parallelGroups;
}
the new c’tor, after deleting “forbiddenHours”:
public MemoryDB(List<Grade> allGrades, List<Teacher> allTeachers, List<Group> allGroups, List<List<Teacher>> staffs, List<List<Group>> parallelGroups)
{
CheckParametersValidation(allGrades, allTeachers, allGroups, staffs, parallelGroups);
this.allGrades = allGrades;
this.allTeachers = allTeachers;
this.allGroups = allGroups;
this.staffs = staffs;
this.parallelGroups = parallelGroups;
}
It is difficult to tell why this happens, but there are certain things to look for when troubleshooting such an issue: