General Class Testing

More than a question, this is an attempt to compare notes with other people. I wrote a generic History class that emulates browser history functionality. I'm trying to think about how far I can go when writing unit tests for this. I'm using NUnit. Please share your testing approaches below.

The full code for the History class is here ( http://pastebin.com/ZGKK2V84 ).

+3
source share
3 answers

Although this question is a bit vague, in general, with such a class, I would suggest testing the following, at a minimum:

  • API, , ""
  • ( , , ?), , , ,
  • , , ( )
+8

, , - ? :)

T , int, History<int>, . . , , , . :) , , .

+3

Write a generic test class that reflects a generic class. Then create another test class that creates an instance of this test class with several different type arguments (a value type and a reference type of some kind are a good start).

+1
source

Source: https://habr.com/ru/post/1749771/


All Articles