-
Notifications
You must be signed in to change notification settings - Fork 71
/
SimpleAggregatorDemo.java
49 lines (38 loc) · 1.13 KB
/
SimpleAggregatorDemo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Copyright 2016-2023 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/
package org.junitpioneer.jupiter.params;
import java.time.LocalDate;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
public class SimpleAggregatorDemo {
// tag::basic_example[]
@ParameterizedTest
@CsvSource({ "Jane, Doe, F, 1990-05-20", "John, Doe, M, 1990-10-22" })
void test(@Aggregate Person person) {
}
// end::basic_example[]
static class Person {
// tag::person_class[]
private final String firstName;
private final String lastName;
private final Gender gender;
private final LocalDate birthday;
// end::person_class[]
public Person(String firstName, String lastName, Gender gender, LocalDate birthday) {
this.firstName = firstName;
this.lastName = lastName;
this.gender = gender;
this.birthday = birthday;
}
}
enum Gender {
F, M, X
}
}