use of com.thoughtworks.go.config.Resource in project gocd by gocd.
the class ResourcesTest method shouldNotAllowBlankNames.
@Test
public void shouldNotAllowBlankNames() {
Resources resources = new Resources();
resources.add(new Resource(""));
assertThat(resources.size(), is(0));
resources.add(new Resource(" "));
assertThat(resources.size(), is(0));
}
use of com.thoughtworks.go.config.Resource in project gocd by gocd.
the class ResourcesTest method shouldCompareBasedOnResourceListItHas.
@Test
public void shouldCompareBasedOnResourceListItHas() {
Resources resourcesA = new Resources();
Resources resourcesB = new Resources();
resourcesA.add(new Resource("xyz"));
resourcesA.add(new Resource("aaa"));
resourcesB.add(new Resource("xyz"));
resourcesB.add(new Resource("bbb"));
assertThat(resourcesA.compareTo(resourcesB), is(lessThan(0)));
assertThat(resourcesB.compareTo(resourcesA), is(greaterThan(0)));
}
use of com.thoughtworks.go.config.Resource in project gocd by gocd.
the class AssertHelper method assertResources.
private static void assertResources(Resources actual, Resources expect) {
assertThat(actual.size(), is(expect.size()));
for (int i = 0; i < expect.size(); i++) {
Resource expectResource = expect.get(i);
Resource actualResource = actual.get(i);
assertThat("Resources should match", actualResource.getName(), is(expectResource.getName()));
}
}
Aggregations