use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method with_prefix_no_reasons.
@Test
public void with_prefix_no_reasons() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot change");
buf.append(false, "reason #1");
buf.append(false, "reason #2");
Assertions.assertThat(buf.getReason()).isNull();
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method using_predicates.
@Test
public void using_predicates() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot change");
buf.append(() -> false, "reason #1");
buf.append(false, "reason #2");
buf.append(true, "reason #3");
buf.append(() -> true, "reason #4");
Assertions.assertThat(buf.getReason()).isEqualTo("Cannot change: reason #3; reason #4");
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method with_prefix_single_reasons.
@Test
public void with_prefix_single_reasons() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot change");
buf.append(true, "reason #1");
buf.append(false, "reason #2");
Assertions.assertThat(buf.getReason()).isEqualTo("Cannot change reason #1");
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method plus.
@Test
public void plus() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("prefix A");
final ReasonBuffer2 buf2 = ReasonBuffer2.forAll("prefix B");
buf.append(true, "reason #1");
buf.append(false, "reason #2");
buf.append(true, "reason #3");
buf.append(false, "reason #4");
buf.append(true, "reason #5");
buf.append(true, "reason #6");
Assertions.assertThat(buf.getReason()).isEqualTo("prefix A: reason #1; reason #3; reason #5; reason #6");
}
use of org.estatio.module.base.platform.applib.ReasonBuffer2 in project estatio by estatio.
the class ReasonBuffer2_Test method with_prefix.
@Test
public void with_prefix() throws Exception {
final ReasonBuffer2 buf = ReasonBuffer2.forAll("Cannot change");
buf.append(true, "reason #1");
buf.append(false, "reason #2");
buf.append(true, "reason #3");
Assertions.assertThat(buf.getReason()).isEqualTo("Cannot change: reason #1; reason #3");
}
Aggregations