I am writing tests for a program I intend to write that checks for certain lines in configuration files.
For example, the program might check that the line: AllowConnections- is contained in the file SomeFile.conf.
My function stub does not take any arguments because I know the file that I am going to be checking.
I am trying to write a tests for this function that check the behavior for different SomeFile.conf files, but I don't see how I could do this. It is possible to change SomeFile.conf in the setup and teardown test functions, but this seems like a bad way to test. Should I change the function so that it can accept a file argument just for the sake of testing?
Aucun commentaire:
Enregistrer un commentaire