Package dom.todo

Examples of dom.todo.ToDoItem


        // then published and received
        @SuppressWarnings("unchecked")
        final PropertyChangedEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyChangedEvent.class);
        assertThat(ev, is(not(nullValue())));

        ToDoItem source = ev.getSource();
        assertThat(source, is(equalTo(unwrap(toDoItem))));
        assertThat(ev.getIdentifier().getMemberName(), is("description"));
        assertThat(ev.getOldValue(), is("Buy bread"));
        assertThat(ev.getNewValue(), is("Buy bread and butter"));
    }
View Full Code Here


        assertThat(foobarList.size(), is(5));
    }

    @Test
    public void canCreateToDoItem() throws Exception {
        ToDoItem newItem = toDoItems.newToDo("item description");
        assertThat(newItem, is(not(nullValue())));
        assertThat(newItem.getDescription(), is("item description"));
        assertThat(getDomainObjectContainer().isPersistent(newItem), is(true));
    }
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

        assertThat(foobarList.size(), is(5));
    }

    @Test
    public void canCreateToDoItem() throws Exception {
        ToDoItem newItem = toDoItemRepository.newToDo("item description");
        assertThat(newItem, is(not(nullValue())));
        assertThat(newItem.getDescription(), is("item description"));
        assertThat(getDomainObjectContainer().isPersistent(newItem), is(true));
    }
View Full Code Here

            final Category category, Subcategory subcategory,
            final String user,
            final LocalDate dueBy,
            final BigDecimal cost,
            final ExecutionContext executionContext) {
        ToDoItem newToDo = toDoItems.newToDo(description, category, subcategory, user, dueBy, cost);
        return executionContext.add(this, newToDo);
    }
View Full Code Here

        complete(ownedBy, "Buy stamps", executionContext);
        complete(ownedBy, "Write blog post", executionContext);
    }

    private void complete(final String user, final String description, final ExecutionContext executionContext) {
        final ToDoItem toDoItem = findToDoItem(description, user);
        toDoItem.setComplete(true);
        executionContext.add(this, toDoItem);
    }
View Full Code Here

     * Hook to initialize if possible.
     */
    @Override
    protected void init(Object obj, String str) {
        if(obj instanceof ToDoItem) {
            ToDoItem toDoItem = (ToDoItem) obj;
            toDoItem.setDescription(str);
        }
    }
View Full Code Here

        putVar("todo", "toDoItem", notYetComplete.get(0));
    }
   
    @When("^mark the item as complete${symbol_dollar}")
    public void mark_it_as_complete() throws Throwable {
        final ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
        if(supportsMocks()) {
            final Bulk.InteractionContext bulkInteractionContext = service(Bulk.InteractionContext.class);
            final EventBusService eventBusService = service(EventBusService.class);
            checking(new Expectations() {
                {
                    allowing(bulkInteractionContext);
                    allowing(eventBusService);
                }
            });
            toDoItem.injectBulkInteractionContext(bulkInteractionContext);
            toDoItem.injectEventBusService(eventBusService);
        }
        wrap(toDoItem).completed();
    }
View Full Code Here

        wrap(toDoItem).completed();
    }
   
    @Then("^the item is no longer listed as incomplete${symbol_dollar}")
    public void the_item_is_no_longer_listed_as_incomplete() throws Throwable {
        ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
        whetherNotYetCompletedContains(toDoItem, false);
    }
View Full Code Here

        }
    }

    @When("^I mark the .*item as not yet complete${symbol_dollar}")
    public void I_mark_it_as_not_yet_complete() throws Throwable {
        ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
        assertThat(toDoItem.isComplete(), is(true));
       
        toDoItem.setComplete(false);
    }
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.