@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class EventAlarmViewTest {
private String inverterId = "inverter1";
@Test
public void whenHasAlarmErrorThenShowAlarmErrorDetails() {
// given
EventAlarmView view = new EventAlarmView(inverterId, 4, 0, 0, 0, 0, new TripleVoltage(51, 51, 51));
// when
Map<String, String> result = view.showAlarmView();
// then
assertThat(result, hasEntry("div_pv_tips_1", HTML_WARN_IMG));
assertThat(result, hasEntry("div_alarm_panel", HTML_ALARM_ON_IMG + HTML_ALARM_ON_AUDIO));
}
}
使用注释 @FixMethodOrder
本文介绍了一种使用JUnit注解@FixMethodOrder进行方法顺序测试的事件警报视图测试案例,包括给定参数创建视图、展示视图并验证显示的错误细节。
1189

被折叠的 条评论
为什么被折叠?



