The code below for the test for the House class of the project have the following asserts, for which the the first three seem to be written correctly (they use House.Entry). The ones for kitchen and the rest of the rooms of the house seem to be incorrect as they are defined in the House as "var" within a static constructor and are not field members of the class and thus would not be accessible directly outside it as described in the solution.
Unless I'm missing something let me know.
incorrect (from below):
var kitchen = hallway.GetExit(Direction.Northwest);
Assert.AreEqual("Kitchen", kitchen.Name);
correct (what it should be):
var kitchen = House.Entry.Exits[Direction.NorthWest];
Assert.AreEqual("Kitchen",kitchen.Name);
(Excerpt from the solution) as written in the addendum project solution online:
[TestMethod]
public void TestLayout()
{
Assert.AreEqual("Entry", House.Entry.Name);
var garage = House.Entry.GetExit(Direction.Out);
Assert.AreEqual("Garage", garage.Name);
var hallway = House.Entry.GetExit(Direction.East);
Assert.AreEqual("Hallway", hallway.Name);
var kitchen = hallway.GetExit(Direction.Northwest);
Assert.AreEqual("Kitchen", kitchen.Name);
var bathroom = hallway.GetExit(Direction.North);
Assert.AreEqual("Bathroom", bathroom.Name);
....
}
The code below for the test for the House class of the project have the following asserts, for which the the first three seem to be written correctly (they use House.Entry). The ones for kitchen and the rest of the rooms of the house seem to be incorrect as they are defined in the House as "var" within a static constructor and are not field members of the class and thus would not be accessible directly outside it as described in the solution.
Unless I'm missing something let me know.
incorrect (from below):
correct (what it should be):
(Excerpt from the solution) as written in the addendum project solution online: