I have just attended my first lesson on cppUnit testing in school and it's quite crazy that I have to write a c++ program and also come up with unit test as well for my assignment.
I am quite lost of
1) how to write a cppUnit testing
2) what kind of things should be included inside the unit test for my program.
assuming I have program that allows a user to
1) requires the user to login to the system first.
after they have log in they can do the following things
2) add a sales transaction to a text file
3) edit a sales transaction from a text file
4) remove a sales transcation from a text file
4) display sales transcation
5) print sales transcation for current day
I have seen many examples online and most of the unit test examples shown are all related to formulas like(+ - \ *).
I not sure if I am correct to say this but correct me if I am wrong, are test units used to test basically on whether a formula is working correctly in a program?
so things like e.g(in my program) "adding a sales transaction to a text file" does not have anything to do with formulas like(+ - \ *) and should be excluded?
Please advice.Thanks in advance.