Package dom.todo

Examples of dom.todo.ToDoItem


        toDoItem.setComplete(false);
    }

    @Then("^the .*item is listed as incomplete${symbol_dollar}")
    public void the_item_is_listed_as_incomplete() throws Throwable {
        ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
        whetherNotYetCompletedContains(toDoItem, true);
    }
View Full Code Here


       
        // given
        int size = wrap(service(ToDoItems.class)).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));
    }
View Full Code Here

    @Test
    public void complete_and_notYetComplete() throws Exception {
       
        // given
        List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
        final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
       
        // when
        toDoItem.completed();
       
        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize-1));
        assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize+1));
       
        // and when
        toDoItem.notYetCompleted();
       
        // then
        assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize));
        assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize));
    }
View Full Code Here

    @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
    public void unitFixtures() throws Throwable {
        final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
        inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
        inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
        final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
        t3.setComplete(true);
        putVar("isis", "in-memory-db", inMemoryDB);
    }
View Full Code Here

   
    // {{ NewToDo
    @Override
    public ToDoItem newToDo(String description) {
        ToDoItem toDoItem = newTransientInstance(ToDoItem.class);
        toDoItem.setDescription(description);
        persist(toDoItem);
        return toDoItem;
    }
View Full Code Here

TOP

Related Classes of dom.todo.ToDoItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.