Exploring Testing

Hi there, hope you have a nice day. For the past week, I have been working on doing some changes for my test case. Focusing on do a little changes and add some new methods to make the test case passed without errors.

First and foremost, during last week I been doing some changes in the test case. I learned a lot of new things, methods and also a function. For example, the difference between mockClear and mockReset. MockClear does and also removes any mocked return values or implementations. Often this is useful when you want to clean up a mock usage data between two assertions. Beware that this method will replace the function, not just calls and also instances. You should therefore avoid assigning to other variables, temporary or not, to make sure it do not access stale data. Meanwhile, mockReset will reset all information stored in the mock, including any initial implementation and mock name given. This is useful when you want to completely restore a mock back to its initial state.

Furthermore, I also add a new test for another view. I been explore several files that related with the test and try to know and understand the component that are correlate with the test. In conclusion, I want to thank Peter for his suggestions and the chance to learn more about writing test cases. Even though I occasionally find it difficult, I am eager to keep developing and expanding my knowledge.

Leave a Reply