I created an app to tweet twice automatically each day. Now I’m told to write the test files.
The tweet itself is generated by strings and also data from a database.
String actual = genTweet();
String expected = "Company Most Active ($Vol. in Millions) | SCZZL $19.5 | HUTC $18.1 | TSCDY $18.0 | TOELY $16.2 | GBGM $15.7 | More at: http://www.website.com/home";
assertEquals(expected, actual);
I’m thinking, how the heck does one even test this? The dollar values and the symbols change constantly, so every time actual != expected.
Any suggestion will be greatly appreciated!!!
You don’t typically run tests against a production server. Instead, use a test server with predicable data completely under your control.