Assert Method

We could create more complex assertion. The expected result contains of 2 books, Hunger Games and Hunger Games 2.

// Assert
Assert.AreEqual(2, model.Count());
Assert.AreEqual("Hunger Games", model.ToList()[0].Name);
Assert.AreEqual("Hunger Games 2", model.ToList()[1].Name);

Build and Run the test, then it will be failed.

results matching ""

    No results matching ""