项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testMapStrProperty(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
ObservableMap<String,CustomObject> mapEmpty = FXCollections.emptyObservableMap();
ObservableMap<String,CustomObject> mapOne = FXCollections.observableHashMap();
mapOne.put("key1",one);
ObservableMap<String,CustomObject> mapTwo = FXCollections.observableHashMap();
mapTwo.put("key1",one);
mapTwo.put("key2",two);
testProperty(WithMapStrProp.class,null,"{\"prop\":null}",o -> o.prop,gson);
testProperty(WithMapStrProp.class,mapEmpty,"{\"prop\":{}}",mapOne,"{\"prop\":{\"key1\":{\"name\":\"myObj1\"}}}",mapTwo,"{\"prop\":{\"key1\":{\"name\":\"myObj1\"},\"key2\":{\"name\":\"myObj2\"}}}",gson);
}
项目:xpath-to-xml
文件:EqualsExprTest.java
@Theory
public void shouldAssociativelyResolveEqualViewsToTrue(@FromDataPoints("eq left") View<TestNode> left,@FromDataPoints("eq left") View<TestNode> right) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,parentNode,false);
// when
View<TestNode> leftToRight = new EqualsExpr(leftExpr,rightExpr).resolve(context);
View<TestNode> rightToLeft = new EqualsExpr(rightExpr,leftExpr).resolve(context);
// then
assertthat(leftToRight).isEqualTo(BooleanView.of(true));
assertthat(rightToLeft).isEqualTo(BooleanView.of(true));
}
项目:xpath-to-xml
文件:EqualsExprTest.java
@Theory
public void shouldAssociativelyResolveNonEqualViewsToFalse(@FromDataPoints("eq left") View<TestNode> left,@FromDataPoints("eq right") View<TestNode> right) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,leftExpr).resolve(context);
// then
assertthat(leftToRight).isEqualTo(BooleanView.of(false));
assertthat(rightToLeft).isEqualTo(BooleanView.of(false));
}
项目:xpath-to-xml
文件:EqualsExprTest.java
@Theory
public void shouldApplyRightViewToLeftViewWhenShouldCreate(@FromDataPoints("eq left") View<TestNode> left,@FromDataPoints("eq right") View<TestNode> right) {
// given
if (!(left instanceof NodeView)
&& (!(left instanceof NodeSetView) || !(((NodeSetView) left).iterator().next() instanceof NodeView))) {
expectedException.expect(XmlBuilderException.class);
}
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,true);
// when
View<TestNode> result = new EqualsExpr(leftExpr,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(true));
verify(navigator).setText(any(TestNode.class),eq(right.toString()));
}
项目:xpath-to-xml
文件:NotEqualsExprTest.java
@Theory
public void shouldAssociativelyResolveEqualViewsToFalse(@FromDataPoints("ne left") View<TestNode> left,@FromDataPoints("ne left") View<TestNode> right) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,false);
// when
View<TestNode> leftToRight = new NotEqualsExpr(leftExpr,rightExpr).resolve(context);
View<TestNode> rightToLeft = new NotEqualsExpr(rightExpr,leftExpr).resolve(context);
// then
assertthat(leftToRight).isEqualTo(BooleanView.of(false));
assertthat(rightToLeft).isEqualTo(BooleanView.of(false));
}
项目:xpath-to-xml
文件:NotEqualsExprTest.java
@Theory
public void shouldAssociativelyResolveNonEqualViewsToTrue(@FromDataPoints("ne left") View<TestNode> left,@FromDataPoints("ne right") View<TestNode> right) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,leftExpr).resolve(context);
// then
assertthat(leftToRight).isEqualTo(BooleanView.of(true));
assertthat(rightToLeft).isEqualTo(BooleanView.of(true));
}
项目:xpath-to-xml
文件:NotEqualsExprTest.java
@Theory
public void shouldApplyRightViewToLeftViewWhenShouldCreate(@FromDataPoints("ne left") View<TestNode> left,@FromDataPoints("ne left") View<TestNode> right) {
// given
if (!(left instanceof NodeView)
&& (!(left instanceof NodeSetView) || !(((NodeSetView) left).iterator().next() instanceof NodeView))) {
expectedException.expect(XmlBuilderException.class);
}
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,true);
// when
View<TestNode> result = new NotEqualsExpr(leftExpr,eq(Boolean.toString(!right.toBoolean())));
}
项目:spring-credhub
文件:CredHubTemplateSummaryResponseUnitTests.java
@Theory
public void findByName(@FromDataPoints("responses")
ResponseEntity<CredentialSummaryData> expectedResponse) {
when(restTemplate.getForEntity(NAME_LIKE_URL_QUERY,CredentialSummaryData.class,NAME.getName()))
.thenReturn(expectedResponse);
if (!expectedResponse.getStatusCode().equals(OK)) {
try {
credHubTemplate.findByName(NAME);
fail("Exception should have been thrown");
}
catch (CredHubException e) {
assertthat(e.getMessage(),containsstring(expectedResponse.getStatusCode().toString()));
}
}
else {
List<CredentialSummary> response = credHubTemplate.findByName(NAME);
assertResponseContainsExpectedCredentials(expectedResponse,response);
}
}
项目:spring-credhub
文件:CredHubTemplateSummaryResponseUnitTests.java
@Theory
public void findByPath(@FromDataPoints("responses")
ResponseEntity<CredentialSummaryData> expectedResponse) {
when(restTemplate.getForEntity(PATH_URL_QUERY,NAME.getName()))
.thenReturn(expectedResponse);
if (!expectedResponse.getStatusCode().equals(OK)) {
try {
credHubTemplate.findByPath(NAME.getName());
fail("Exception should have been thrown");
}
catch (CredHubException e) {
assertthat(e.getMessage(),containsstring(expectedResponse.getStatusCode().toString()));
}
}
else {
List<CredentialSummary> response = credHubTemplate.findByPath(NAME.getName());
assertResponseContainsExpectedCredentials(expectedResponse,response);
}
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testObservableList(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
ObservableList<CustomObject> listempty = FXCollections.observableArrayList();
ObservableList<CustomObject> listOne = FXCollections.observableArrayList(one);
ObservableList<CustomObject> listTwo = FXCollections.observableArrayList(one,two);
Function<WithObsList,ObservableList<CustomObject>> getter = o -> o.list;
BiConsumer<WithObsList,ObservableList<CustomObject>> setter = (o,l) -> o.list = l;
testValue(WithObsList.class,"{\"list\":null}",getter,setter,gson);
testValue(WithObsList.class,listempty,"{\"list\":[]}",listOne,"{\"list\":[{\"name\":\"myObj1\"}]}",listTwo,"{\"list\":[{\"name\":\"myObj1\"},{\"name\":\"myObj2\"}]}",gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testObservableSet(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
ObservableSet<CustomObject> setEmpty = FXCollections.emptyObservableSet();
ObservableSet<CustomObject> setone = FXCollections.observableSet(one);
ObservableSet<CustomObject> setTwo = FXCollections.observableSet(one,two);
Function<WithObsSet,ObservableSet<CustomObject>> getter = o -> o.set;
BiConsumer<WithObsSet,ObservableSet<CustomObject>> setter = (o,s) -> o.set = s;
testValue(WithObsSet.class,"{\"set\":null}",gson);
testValue(WithObsSet.class,setEmpty,"{\"set\":[]}",setone,"{\"set\":[{\"name\":\"myObj1\"}]}",gson);
// do not check a particular JSON because the order is non-deterministic
testValue(WithObsSet.class,setTwo,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testObservableMapStr(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
ObservableMap<String,two);
Function<WithObsMapStr,ObservableMap<String,CustomObject>> getter = o -> o.map;
BiConsumer<WithObsMapStr,CustomObject>> setter = (o,m) -> o.map = m;
testValue(WithObsMapStr.class,"{\"map\":null}",gson);
testValue(WithObsMapStr.class,"{\"map\":{}}","{\"map\":{\"key1\":{\"name\":\"myObj1\"}}}","{\"map\":{\"key1\":{\"name\":\"myObj1\"},gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testMapIntProperty(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
ObservableMap<Integer,CustomObject> mapEmpty = FXCollections.emptyObservableMap();
ObservableMap<Integer,CustomObject> mapOne = FXCollections.observableHashMap();
mapOne.put(1,one);
ObservableMap<Integer,CustomObject> mapTwo = FXCollections.observableHashMap();
mapTwo.put(1,one);
mapTwo.put(2,two);
testProperty(WithMapIntProp.class,gson);
testProperty(WithMapIntProp.class,"{\"prop\":{\"1\":{\"name\":\"myObj1\"}}}","{\"prop\":{\"1\":{\"name\":\"myObj1\"},\"2\":{\"name\":\"myObj2\"}}}",gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testObservableMapInt(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
ObservableMap<Integer,two);
Function<WithObsMapInt,ObservableMap<Integer,CustomObject>> getter = o -> o.map;
BiConsumer<WithObsMapInt,m) -> o.map = m;
testValue(WithObsMapInt.class,gson);
testValue(WithObsMapInt.class,"{\"map\":{\"1\":{\"name\":\"myObj1\"}}}","{\"map\":{\"1\":{\"name\":\"myObj1\"},gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testCustomTreeMapStrProperty(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Map<String,CustomObject> mapEmpty = new TreeMap<>();
Map<String,CustomObject> mapOne = new TreeMap<>();
mapOne.put("key1",one);
Map<String,CustomObject> mapTwo = new TreeMap<>();
mapTwo.put("key1",two);
ObservableMap<String,CustomObject> mapEmptyObs = FXCollections.observableMap(mapEmpty);
ObservableMap<String,CustomObject> mapOneObs = FXCollections.observableMap(mapOne);
ObservableMap<String,CustomObject> mapTwoObs = FXCollections.observableMap(mapTwo);
testProperty(WithMapStrProp.class,mapEmptyObs,mapOneObs,mapTwoObs,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testCustomObservableTreeMapStr(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Map<String,CustomObject> mapTwoObs = FXCollections.observableMap(mapTwo);
Function<WithObsMapStr,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testCustomTreeMapIntProperty(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Map<Integer,CustomObject> mapEmpty = new TreeMap<>();
Map<Integer,CustomObject> mapOne = new TreeMap<>();
mapOne.put(1,one);
Map<Integer,CustomObject> mapTwo = new TreeMap<>();
mapTwo.put(1,two);
ObservableMap<Integer,CustomObject> mapEmptyObs = FXCollections.observableMap(mapEmpty);
ObservableMap<Integer,CustomObject> mapOneObs = FXCollections.observableMap(mapOne);
ObservableMap<Integer,CustomObject> mapTwoObs = FXCollections.observableMap(mapTwo);
testProperty(WithMapIntProp.class,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testCustomObservableTreeMapInt(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Map<Integer,CustomObject> mapTwoObs = FXCollections.observableMap(mapTwo);
Function<WithObsMapInt,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testList(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
List<CustomObject> listempty = Collections.emptyList();
List<CustomObject> listOne = Collections.singletonList(one);
List<CustomObject> listTwo = Arrays.asList(one,two);
Function<WithList,List<CustomObject>> getter = o -> o.list;
BiConsumer<WithList,List<CustomObject>> setter = (o,l) -> o.list = l;
testValue(WithList.class,gson);
testValue(WithList.class,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testSet(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Set<CustomObject> setEmpty = Collections.emptySet();
Set<CustomObject> setone = Collections.singleton(one);
Set<CustomObject> setTwo = new HashSet<>(Arrays.asList(one,two));
Function<WithSet,Set<CustomObject>> getter = o -> o.set;
BiConsumer<WithSet,Set<CustomObject>> setter = (o,s) -> o.set = s;
testValue(WithSet.class,gson);
testValue(WithSet.class,gson);
// do not check a particular JSON because the order is non-deterministic
testValue(WithSet.class,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testMapStr(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Map<String,CustomObject> mapEmpty = Collections.emptyMap();
Map<String,CustomObject> mapOne = Collections.singletonMap("key1",CustomObject> mapTwo = new HashMap<>();
mapTwo.put("key1",two);
Function<WithMapStr,Map<String,CustomObject>> getter = o -> o.map;
BiConsumer<WithMapStr,m) -> o.map = m;
testValue(WithMapStr.class,gson);
testValue(WithMapStr.class,gson);
}
项目:fx-gson
文件:FxGsonTest.java
@Theory
public void testMapInt(@FromDataPoints("all") Gson gson) {
CustomObject one = new CustomObject("myObj1");
CustomObject two = new CustomObject("myObj2");
Map<Integer,CustomObject> mapEmpty = Collections.emptyMap();
Map<Integer,CustomObject> mapOne = Collections.singletonMap(1,CustomObject> mapTwo = new HashMap<>();
mapTwo.put(1,two);
Function<WithMapInt,Map<Integer,CustomObject>> getter = o -> o.map;
BiConsumer<WithMapInt,m) -> o.map = m;
testValue(WithMapInt.class,gson);
testValue(WithMapInt.class,gson);
}
项目:fast-rng-java
文件:BetaRNGTest.java
@Theory
public void testGoodnessOfFitByTwoLevelTesting(
@FromDataPoints("N") final int N,@FromDataPoints("K") final int K,final BetadistParam parameters,final BetaRNG betaRNG) {
final double alpha = parameters.alpha;
final double beta = parameters.beta;
System.out.printf("%s: alpha = %.2f,beta = %.2f%n",betaRNG.getClass().getSimpleName(),alpha,beta);
TwoLevelTester tester = new TwoLevelTester(N,K);
tester.test(
random -> betaRNG.generate(random,beta),new Betadistribution(alpha,beta,1e-15));
System.out.println(betaRNG);
}
项目:emr-dynamodb-connector
文件:RateControllerTest.java
@Theory
public void testHappyCase(@FromDataPoints("rates") double rate,@FromDataPoints("sizes") double
itemSize,@FromDataPoints("windows") int windowSize) {
RateController rateCtr = new RateController(time,rate,windowSize,itemSize);
double rcu = 0.0;
// Consume until we get a zero response
RateController.RequestLimit lim;
while ((lim = rateCtr.getNextRequestLimit()) != RateController.RequestLimit.ZERO) {
rcu += lim.readCapacityUnits;
}
// Should not have consumed more IO than rate * bucket window
double bucketCapacity = Math.max(windowSize * rateCtr.getTargetRate(),RateController
.MIN_RCU_PER_REQ);
assertTrue("readCapacityUnits=" + rcu + ",cap=" + bucketCapacity,rcu <= bucketCapacity);
// Should have consumed at least cap - min_per_request
assertTrue(rcu > bucketCapacity - RateController.MIN_RCU_PER_REQ);
}
项目:FSDevTools
文件:SchemaUidToNameBasedLayerMapperTest.java
@Theory
public void testFrom(@FromDataPoints("schemas") String sourceSchemaUID,@FromDataPoints("layers") final String targetLayer)
throws Exception {
map.put(sourceSchemaUID,targetLayer);
if (!"*".equals(sourceSchemaUID)) {
// if layer is without wild card then add wild card to see that it is not used
map.put("*",SchemaUidToNameBasedLayerMapper.CREATE_NEW);
} else {
// if wild card is added then trigger usage of wild card -> rename source schema
sourceSchemaUID = "laleleu_schema";
}
when(schema.getUid()).thenReturn(sourceSchemaUID);
final LayerMapper testling = SchemaUidToNameBasedLayerMapper.from(map);
assertthat(testling,is(notNullValue()));
if (SchemaUidToNameBasedLayerMapper.CREATE_NEW.equals(targetLayer)) {
assertthat(testling.getLayer(context),is(LayerMapper.CREATE_NEW_DEFAULT_LAYER));
} else {
assertthat(testling.getLayer(context),is(targetLayer));
}
}
项目:xpath-to-xml
文件:XPathParserTest.java
@Theory
public void shouldParseSimpleXPath(@FromDataPoints("Positive-Simple") Pair<String,Expr> data,@FromDataPoints("namespaceContexts") NamespaceContext context)
throws XPathExpressionException {
Expr actualExpr = new XPathParser(context).parse(data.getFirst());
assertthat(actualExpr).hasToString(data.getSecond().toString());
}
项目:xpath-to-xml
文件:XPathParserTest.java
@Theory
public void shouldParsePrefixedXPath(@FromDataPoints("Positive-Prefixed") Triple<String,Expr,@FromDataPoints("namespaceContexts") NamespaceContext context)
throws XPathExpressionException {
Expr actualExpr = new XPathParser(context).parse(data.getFirst());
assertthat(actualExpr).hasToString(null == context ? data.getSecond().toString() : data.getThird().toString());
}
项目:xpath-to-xml
文件:XPathParserTest.java
@Theory
public void shouldThrowExceptionOnParse(@FromDataPoints("Negative") String invalidXPath,@FromDataPoints("namespaceContexts") NamespaceContext namespaceContext)
throws XPathExpressionException {
thrown.expect(XPathExpressionException.class);
System.err.println(new XPathParser(namespaceContext).parse(invalidXPath));
}
@Theory
public void shouldResolvetoTrueWhenLeftIsLessthanRight(@FromDataPoints("less") View<TestNode> less,@FromDataPoints("greater") View<TestNode> greater) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(less);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(greater);
ViewContext<TestNode> context = new ViewContext<>(navigator,false);
// when
View<TestNode> result = new LessthanorEqualsExpr(leftExpr,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(true));
}
@Theory
public void shouldResolvetoFalseWhenLeftIsGreaterThanRight(@FromDataPoints("less") View<TestNode> less,@FromDataPoints("greater") View<TestNode> greater) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(greater);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(less);
ViewContext<TestNode> context = new ViewContext<>(navigator,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(false));
}
@Theory
public void shouldResolvetoTrueWhenLeftIsEqualToRight(@FromDataPoints("less") View<TestNode> left,@FromDataPoints("less") View<TestNode> right) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(true));
}
@Theory
public void shouldThrowWhenResolvetoFalseAndShouldCreate(@FromDataPoints("less") View<TestNode> less,@FromDataPoints("greater") View<TestNode> greater) {
// given
expectedException.expect(XmlBuilderException.class);
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(greater);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(less);
ViewContext<TestNode> context = new ViewContext<>(navigator,true);
// when
new LessthanorEqualsExpr(leftExpr,rightExpr).resolve(context);
}
项目:xpath-to-xml
文件:SubtractionExprTest.java
@Theory
public void shouldMultiplyLeftViewToRightView(@FromDataPoints("3.0") View<TestNode> left,@FromDataPoints("3.0") View<TestNode> right) {
// given
when(leftExpr.resolve(any(ViewContext.class))).thenReturn(left);
when(rightExpr.resolve(any(ViewContext.class))).thenReturn(right);
ViewContext<TestNode> context = new ViewContext<>(navigator,new NodeView<>(node("node")),false);
// when
assertthat(new SubtractionExpr(leftExpr,rightExpr).resolve(context)).extracting("number").contains(0.0);
}
项目:xpath-to-xml
文件:UnaryExprTest.java
@Theory
public void shouldAlwaysReturnNegatednumberViewNode(
@FromDataPoints("views") Pair<View<TestNode>,NumberView<TestNode>> data) {
when(valueExpr.resolve(any(ViewContext.class))).thenReturn(data.getFirst());
View<TestNode> result = unaryExpr.resolve(new ViewContext<>(navigator,new NodeView<>(node("xml")),false));
assertthat(result.toNumber()).isEqualTo(data.getSecond().toNumber());
}
@Theory
public void shouldResolvetoTrueWhenLeftIsLessthanRight(@FromDataPoints("less") View<TestNode> less,false);
// when
View<TestNode> result = new LessthanExpr(leftExpr,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(true));
}
@Theory
public void shouldResolvetoFalseWhenLeftIsGreaterThanRight(@FromDataPoints("less") View<TestNode> less,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(false));
}
@Theory
public void shouldResolvetoFalseWhenLeftIsEqualToRight(@FromDataPoints("less") View<TestNode> left,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(false));
}
@Theory
public void shouldResolvetoTrueWhenLeftIsGreaterThanRight(@FromDataPoints("less") View<TestNode> less,false);
// when
View<TestNode> result = new GreaterThanorEqualsExpr(leftExpr,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(true));
}
@Theory
public void shouldResolvetoFalseWhenLeftIsLessthanRight(@FromDataPoints("less") View<TestNode> less,rightExpr).resolve(context);
// then
assertthat(result).isEqualTo(BooleanView.of(false));
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。