Skip to content

Instantly share code, notes, and snippets.

@sujathakvr
Created November 9, 2016 16:52
Show Gist options
  • Save sujathakvr/9eac41c1f8456f0dc7c3ce465a9f71e7 to your computer and use it in GitHub Desktop.
Save sujathakvr/9eac41c1f8456f0dc7c3ce465a9f71e7 to your computer and use it in GitHub Desktop.
package com.ourOffice.test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.ourOffice.utils.Utils;
public class WordCounterTest {
@Test // test.txt -> txt test2.dot -> dot test21.docx -> docx
public final void testGetFileExtension() {
assertEquals("txt", Utils.getFileExtension("test.txt"));
}
@Test
public final void testGetFileExtension1() {
assertEquals("dot", Utils.getFileExtension("test2.dot"));
}
@Test
public final void testGetFileExtension2() {
assertEquals("docx", Utils.getFileExtension("test21.docx"));
}
@Test
public final void testGetFileExtension3() {
assertNull(Utils.getFileExtension("test21"));
}
@Test // test.txt -> txt test2.dot -> dot test21.docx -> docx
public final void testGetFileNameWithoutExtension() {
assertEquals("test", Utils.getFileNameWithoutExtension("test.txt"));
}
@Test // test.txt -> txt test2.dot -> dot test21.docx -> docx
public final void testGetFileNameWithoutExtension1() {
assertEquals("test2", Utils.getFileNameWithoutExtension("test2.dot"));
}
@Test // test.txt -> txt test2.dot -> dot test21.docx -> docx
public final void testGetFileNameWithoutExtension2() {
assertEquals("test21", Utils.getFileNameWithoutExtension("test21.docx"));
}
@Test
public final void testGenerateCsvFile() {
fail("Not yet implemented"); // TODO
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment