Skip to content
Snippets Groups Projects
Commit d1a55b22 authored by Mathieu Poumaere's avatar Mathieu Poumaere
Browse files

add test q2

parent 667ab73a
No related branches found
No related tags found
No related merge requests found
package fr.univlille.iut.r304.tp3.q2;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
public class TestQ1 {
protected Objectif obj1;
protected String txt;
protected String txt2;
protected Txt t;
protected String text;
protected InputStream is;
@BeforeEach
public void setup() {
text = "abc\ndef\n!fin\n";
is = new ByteArrayInputStream(text.getBytes());
obj1= new Objectif(5, "Objectif 1 - nombre de lignes");
t = new Txt(is);
t.attach(obj1);
}
@Test
void Test1(){
t.lancer();
assertTrue(obj1.getNbRestant()==4);
t.lancer();
t.lancer();
assertTrue(obj1.getNbRestant()==2);
assertTrue(t.getListO().isEmpty());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment