mercredi 1 mai 2019

Java JUnit Testing guidance needed

I am trying to run create some tests for the program I have. I am still new to Java and programming as a whole so I am unsure what to do. I have a .csv file lets just call it testdata.csv and I want to look for certain words within that test file for a test. So for example a test that can display multiple strings from within that file and say they are in there.

I have tried using assert.that but it didn't work for me I probably did it wrong. Was just searching online and trying to piece things together. The code I had included was the last attempt I had done and I know it isn't right...


@org.junit.Test
    public void testAssets (){

        String fileName;

        fileName = "testdata.csv";

        Assert.that(fileName, hasItems);


For the test to fail if it doesn't have the string "UDP,TCP,ICMP"

Aucun commentaire:

Enregistrer un commentaire