Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pl.fl1tch.hairdresser.Report;
- import org.junit.Assert;
- import org.junit.Assert.*;
- import org.junit.Test;
- import pl.fl1tch.hairdresser.Model.Client;
- import pl.fl1tch.hairdresser.Model.Hairdresser;
- import pl.fl1tch.hairdresser.Model.ReportRow;
- import pl.fl1tch.hairdresser.Model.Schedule;
- import java.time.LocalDateTime;
- import java.util.Arrays;
- import java.util.List;
- public class ReportTests {
- @Test
- public void report(){
- Client c1 = new Client(0l,"Jacek Wróbel");
- Client c2 = new Client(0l,"Damian Łódzki");
- Hairdresser h1 = new Hairdresser(0l,"Jacek Vadim", LocalDateTime.parse("2019-06-17T10:00"), LocalDateTime.parse("2019-06-17T14:30"));
- Hairdresser h2 = new Hairdresser(0l,"Janusz Paweł", LocalDateTime.parse("2019-06-17T10:00"), LocalDateTime.parse("2019-06-17T17:15"));
- Schedule s1 = new Schedule(0l,h1,c1,LocalDateTime.parse("2019-06-17T14:15"), LocalDateTime.parse("2019-06-17T14:30"));
- Schedule s2 = new Schedule(0l,h2,c2,LocalDateTime.parse("2019-06-17T10:00"), LocalDateTime.parse("2019-06-17T10:15"));
- List<Schedule> given = Arrays.asList(s1,s2);
- ReportRow r1 = new ReportRow("Jacek Vadim", "2019-06-17T14:15", "2019-06-17T14:30");
- ReportRow r2 = new ReportRow("Janusz Paweł", "2019-06-17T10:00", "2019-06-17T10:15");
- Report report = new Report();
- List<ReportRow> expected = Arrays.asList(r1,r2);
- List<ReportRow> result = report.report(given);
- Assert.assertEquals(expected, result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement