Timeline for Python Calculator Test Driven Development
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 10, 2018 at 14:08 | comment | added | MeteHan | @mrblewog I think I allready considered Division By Zero. But I will do "5 + NAN" part. Thanks ! | |
May 10, 2018 at 14:08 | comment | added | MeteHan | Yes I get that but since I will do that with every test, that makes it a repeating block, does it not make sense when I create a common method for randomizing too? | |
May 9, 2018 at 11:21 | comment | added | Srdjan Grubor |
@M.Han no need, you can just have something like x = random.random() , and y = random.random() and you assert with self.assertEquals(x + y) (you can't really assume that the built-in op + is bad).
|
|
May 9, 2018 at 8:56 | comment | added | Rhys |
Re. the antagonist -- you might also consider cases like 5 + NaN and division by zero.
|
|
May 7, 2018 at 20:14 | comment | added | MeteHan | Oh I get what you mean now. And about using random ints, should I generate random ints in every testcase or should I write a common method for generating 2 random ints too ? And is it okay writing a non-test method in Test class? | |
May 7, 2018 at 20:02 | comment | added | Srdjan Grubor | Yeah calling the validation method from every operation is what I meant. As for the raising the error, your tests are not checking the "and" part of the statement in any of the operations. | |
May 7, 2018 at 19:49 | comment | added | MeteHan | If one of the args is invalid it will still raise the error because of the "and" in "if" statment. Should I write a common method and call that method from every function, is that what you mean? And thank you for your review, I really appreciate it | |
May 7, 2018 at 16:50 | history | edited | Srdjan Grubor | CC BY-SA 4.0 |
Edited to fix a grammar error
|
May 7, 2018 at 16:27 | history | answered | Srdjan Grubor | CC BY-SA 4.0 |