/** Test method for {@link edu.ltu.stringreporter.StringReporter#handleFile(java.io.File)}. */ @Test public void testHandleFile() { // Test that txt file works try { StringReporter.handleFile(new File("test.txt")); } catch (Exception e) { Assert.fail("Exception thrown for valid file"); } // Test that non-txt file doesn't work try { StringReporter.handleFile(new File("test.png")); } catch (Exception e) { return; } Assert.fail("Exception not thrown for invalid file"); }