當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。