本文整理汇总了Java中dom.todo.ToDoItem.Category类的典型用法代码示例。如果您正苦于以下问题:Java Category类的具体用法?Java Category怎么用?Java Category使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Category类属于dom.todo.ToDoItem包,在下文中一共展示了Category类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: happyCase
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void happyCase() throws Exception {
// given
int size = wrap(toDoItems).notYetComplete().size();
// when
final ToDoItem newToDo = wrap(service(ToDoItems.class)).newToDo("new todo", Category.Professional, Subcategory.OpenSource, null, null);
// then
assertThat(newToDo.getDescription(), is("new todo"));
assertThat(newToDo.getCategory(), is(Category.Professional));
assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size+1));
// when
newToDo.delete();
// then
assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size));
}
示例2: happyCase
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void happyCase() throws Exception {
// when
toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, Subcategory.Consulting);
// then
assertThat(toDoItem.getCategory(), is(Category.Professional));
assertThat(toDoItem.getSubcategory(), is(Subcategory.Consulting));
// when
toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Domestic, Subcategory.Chores);
// then
assertThat(toDoItem.getCategory(), is(Category.Domestic));
assertThat(toDoItem.getSubcategory(), is(Subcategory.Chores));
}
示例3: install
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Override
public void install() {
removeAllToDosForCurrentUser();
createToDoItemForCurrentUser("Buy milk", Category.Domestic, daysFromToday(0));
createToDoItemForCurrentUser("Buy stamps", Category.Domestic, daysFromToday(0));
createToDoItemForCurrentUser("Pick up laundry", Category.Other, daysFromToday(6));
createToDoItemForCurrentUser("Write blog post", Category.Professional, null);
ToDoItem workOnIsis = createToDoItemForCurrentUser("Work on Isis Viewer", Category.Professional, daysFromToday(14));
createToDoItemForCurrentUser("Buy food", Category.Domestic, true, daysFromToday(-2));
createToDoItemForCurrentUser("Write to Dan", Category.Professional, null,workOnIsis);
getContainer().flush();
}
示例4: newToDo
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Hidden // for use by fixtures
public ToDoItem newToDo(
String description,
Category category,
Boolean status,
Date dueBy) {
final String userName = currentUserName();
final ToDoItem toDoItem = newTransientInstance(ToDoItem.class);
toDoItem.setDescription(description);
toDoItem.setCategory(category);
toDoItem.setComplete( status );
toDoItem.setOwnedBy(userName);
toDoItem.setDueBy(dueBy);
persist(toDoItem);
return toDoItem;
}
示例5: happyCase
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void happyCase() throws Exception {
// given
int size = wrap(toDoItems).notYetComplete().size();
// when
final ToDoItem newToDo = wrap(toDoItems).newToDo("new todo", Category.Professional, null, null);
// then
assertThat(newToDo.getDescription(), is("new todo"));
assertThat(newToDo.getCategory(), is(Category.Professional));
assertThat(wrap(toDoItems).notYetComplete().size(), is(size+1));
// when
newToDo.delete();
// then
assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
}
示例6: newToDo
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Hidden // for use by fixtures
public ToDoItem newToDo(
final String description,
final Category category,
final String userName,
final LocalDate dueBy,
final BigDecimal cost) {
final ToDoItem toDoItem = newTransientInstance(ToDoItem.class);
toDoItem.setDescription(description);
toDoItem.setCategory(category);
toDoItem.setOwnedBy(userName);
toDoItem.setDueBy(dueBy);
toDoItem.setCost(cost);
//
// GMAP3: uncomment to use https://github.com/danhaywood/isis-wicket-gmap3
// toDoItem.setLocation(
// new Location(51.5172+random(-0.05, +0.05), 0.1182 + random(-0.05, +0.05)));
//
persist(toDoItem);
return toDoItem;
}
示例7: cannotModify
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void cannotModify() throws Exception {
// when, then
expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
toDoItem.setCategory(Category.Professional);
}
示例8: subcategoryMustBelongToCategory
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void subcategoryMustBelongToCategory() throws Exception {
// when, then
expectedExceptions.expectMessage(containsString("Invalid subcategory"));
toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, Subcategory.Chores);
}
示例9: installFor
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
public void installFor(String user) {
removeAllToDosFor(user);
createToDoItemForUser("Buy milk", Category.Domestic, user, daysFromToday(0), new BigDecimal("1.50"));
createToDoItemForUser("Buy stamps", Category.Domestic, user, daysFromToday(0), new BigDecimal("10.00"));
createToDoItemForUser("Pick up laundry", Category.Other, user, daysFromToday(6), new BigDecimal("7.50"));
createToDoItemForUser("Write blog post", Category.Professional, user, null, null);
createToDoItemForUser("Organize brown bag", Category.Professional, user, daysFromToday(14), null);
getContainer().flush();
}
示例10: happyCase
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void happyCase() throws Exception {
// when
toDoItem.setCategory(Category.Professional);
// then
assertThat(toDoItem.getCategory(), is(Category.Professional));
// when
toDoItem.setCategory(Category.Domestic);
// then
assertThat(toDoItem.getCategory(), is(Category.Domestic));
}
示例11: subcategoryCanBeNull
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void subcategoryCanBeNull() throws Exception {
// when, then
toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, null);
}
示例12: createToDoItemForCurrentUser
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
private ToDoItem createToDoItemForCurrentUser(final String description, final Category category, final Date dueBy) {
return toDoItems.newToDo(description, category, dueBy);
}
示例13: createToDoItemForUser
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
private ToDoItem createToDoItemForUser(final String description, final Category category, String user, final Date dueBy) {
return toDoItems.newToDo(description, category, user, dueBy);
}
示例14: createToDoItemForUser
import dom.todo.ToDoItem.Category; //导入依赖的package包/类
private ToDoItem createToDoItemForUser(final String description, final Category category, String user, final LocalDate dueBy, final BigDecimal cost) {
return toDoItems.newToDo(description, category, user, dueBy, cost);
}