当前位置: 首页>>代码示例>>Java>>正文


Java Category类代码示例

本文整理汇总了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));
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:21,代码来源:ToDoItemsTest_newToDo_and_delete.java

示例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));
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:18,代码来源:ToDoItemContributionsTest_updateCategory.java

示例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();
}
 
开发者ID:madytyoo,项目名称:dhtmlx-isis-viewer,代码行数:18,代码来源:ToDoItemsFixture.java

示例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;
}
 
开发者ID:madytyoo,项目名称:dhtmlx-isis-viewer,代码行数:17,代码来源:ToDoItems.java

示例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));
}
 
开发者ID:bhargavgolla,项目名称:isisJavaScript,代码行数:21,代码来源:ToDoItems_newToDo_and_delete.java

示例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;
}
 
开发者ID:bhargavgolla,项目名称:isisJavaScript,代码行数:24,代码来源:ToDoItems.java

示例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);
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:8,代码来源:ToDoItemTest_category.java

示例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);
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:8,代码来源:ToDoItemContributionsTest_updateCategory.java

示例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();
    }
 
开发者ID:bhargavgolla,项目名称:isisJavaScript,代码行数:13,代码来源:ToDoItemsFixture.java

示例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));
}
 
开发者ID:bhargavgolla,项目名称:isisJavaScript,代码行数:16,代码来源:ToDoItem_category.java

示例11: subcategoryCanBeNull

import dom.todo.ToDoItem.Category; //导入依赖的package包/类
@Test
public void subcategoryCanBeNull() throws Exception {
    
    // when, then
    toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, null);
}
 
开发者ID:resto-tesis,项目名称:resto-tesis,代码行数:7,代码来源:ToDoItemContributionsTest_updateCategory.java

示例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);
}
 
开发者ID:madytyoo,项目名称:dhtmlx-isis-viewer,代码行数:4,代码来源:ToDoItemsFixture.java

示例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);
}
 
开发者ID:madytyoo,项目名称:dhtmlx-isis-viewer,代码行数:4,代码来源:ToDoItemsFixture.java

示例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);
}
 
开发者ID:bhargavgolla,项目名称:isisJavaScript,代码行数:4,代码来源:ToDoItemsFixture.java


注:本文中的dom.todo.ToDoItem.Category类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。