Dodanie nowego testu do dodawnia kursu.

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-09-16 17:14:37 +02:00
parent 579da3f038
commit 43660c4fe9

View File

@ -0,0 +1,32 @@
package com.plannaplan.services;
import static org.junit.Assert.assertTrue;
import com.plannaplan.entities.Course;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
@ContextConfiguration
public class CourseServiceTest {
@Autowired
private CourseService courseService;
@Test
public void shoulReturnYes() {
Course course;
int startAmmount = this.courseService.getCoursesAmmount();
course = new Course();
course.setName("Testowy kurs");
course.setSymbol("TK");
courseService.save(course);
assertTrue(this.courseService.getCoursesAmmount() > startAmmount);
}
}