本文整理了Java中org.mozilla.zest.core.v1.ZestExpressionStatusCode.setInverse()
方法的一些代码示例,展示了ZestExpressionStatusCode.setInverse()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZestExpressionStatusCode.setInverse()
方法的具体详情如下:
包路径:org.mozilla.zest.core.v1.ZestExpressionStatusCode
类名称:ZestExpressionStatusCode
方法名:setInverse
暂无
代码示例来源:origin: mozilla/zest
@Override
public ZestExpressionStatusCode deepCopy() {
ZestExpressionStatusCode copy = new ZestExpressionStatusCode();
copy.code = code;
copy.setInverse(isInverse());
return copy;
}
代码示例来源:origin: mozilla/zest
@Test
public void shouldSetInverse() {
// Given
ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode();
// When
statusCodeExpression.setInverse(true);
// Then
assertTrue(statusCodeExpression.isInverse());
}
代码示例来源:origin: mozilla/zest
@Test
public void shouldEvaluateToTrueIfInverseAndNotSameStatusCode() throws Exception {
// Given
ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode(200);
statusCodeExpression.setInverse(true);
ZestResponse response = createResponse(500);
// When
boolean result = statusCodeExpression.evaluate(new TestRuntime(response));
// Then
assertTrue(result);
}
代码示例来源:origin: mozilla/zest
@Test
public void shouldEvaluateToFalseIfInverseAndSameStatusCode() throws Exception {
// Given
ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode(200);
statusCodeExpression.setInverse(true);
ZestResponse response = createResponse(200);
// When
boolean result = statusCodeExpression.evaluate(new TestRuntime(response));
// Then
assertFalse(result);
}
代码示例来源:origin: mozilla/zest
@Test
public void shouldDeepCopy() {
// Given
ZestExpressionStatusCode statusCodeExpression = new ZestExpressionStatusCode(404);
statusCodeExpression.setInverse(true);
// When
ZestExpressionStatusCode copyStatusCodeExpression = statusCodeExpression.deepCopy();
// Then
assertTrue(copyStatusCodeExpression != statusCodeExpression);
assertEquals(copyStatusCodeExpression.getCode(), statusCodeExpression.getCode());
assertEquals(copyStatusCodeExpression.isInverse(), statusCodeExpression.isInverse());
}
内容来源于网络,如有侵权,请联系作者删除!