Questions
The following questions will test your knowledge of the topics that were covered in this chapter:
- We have the following xUnit test method, but it isn't being picked up by the test runner. What's wrong?
public void Minus_When2Integers_ShouldReturnCorrectInteger() { var result = Calc.Add(2, 1); Assert.Equal(1, result); } - We have aÂ
string variable calledÂsuccessMessage in a xUnit test and we need to check that it contains the wordÂ"success". What method in theÂAssert class could we use? - We have created some Jest unit tests on aÂ
List component in a file calledÂListTests.tsx. However, when the Jest test runner runs, the tests aren't picked up. Why is this happening? - We are implementing a test in Jest and we have a variable calledÂ
result that we want to check isn'tÂnull. Which Jest matcher function can we use? - Let's say we have a variable calledÂ
person...