Package dom.todo

Examples of dom.todo.ToDoItem


        wrap(toDoItem).completed();
    }
   
    @Then("^the item is no longer listed as incomplete$")
    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$")
    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

        toDoItem.setComplete(false);
    }

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

                // sent to both the general on(ActionInteractionEvent ev)
                // and also the specific on(final ToDoItem.CompletedEvent ev)
                assertThat(receivedEvents.size(), is(5*2));
                final ToDoItem.CompletedEvent ev = receivedEvents.get(0);

                ToDoItem source = ev.getSource();
                assertThat(source, is(equalTo(unwrap(toDoItem))));
                assertThat(ev.getIdentifier().getMemberName(), is("completed"));
            }
View Full Code Here

                // and then
                final ActionInteractionEvent<ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionInteractionEvent.class);
                assertThat(ev, is(not(nullValue())));

                ToDoItem source = ev.getSource();
                assertThat(source, is(equalTo(unwrap(toDoItem))));
                assertThat(ev.getIdentifier().getMemberName(), is("notYetCompleted"));
            }
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

                // then published and received
                @SuppressWarnings("unchecked")
                final PropertyInteractionEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyInteractionEvent.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

        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

        @Test
        public void complete_and_notYetComplete() throws Exception {

            // given
            List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
            final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
            nextTransaction();

            // when
            toDoItem.completed();
            nextTransaction();

            // then
            assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize-1));
            assertThat(wrap(toDoItems).complete().size(), is(completedSize+1));
            nextTransaction();

            // and when
            toDoItem.notYetCompleted();
            nextTransaction();

            // then
            assertThat(wrap(toDoItems).notYetComplete().size(), is(notYetCompletedSize));
            assertThat(wrap(toDoItems).complete().size(), is(completedSize));
View Full Code Here

            // given
            int size = wrap(toDoItems).notYetComplete().size();
            nextTransaction();

            // when
            final ToDoItem newToDo = toDoItems.newToDo("new todo", ToDoItem.Category.Professional, ToDoItem.Subcategory.OpenSource, null, null);
            nextTransaction();

            // then
            assertThat(newToDo.getDescription(), is("new todo"));
            assertThat(newToDo.getCategory(), is(ToDoItem.Category.Professional));
            assertThat(wrap(toDoItems).notYetComplete().size(), is(size+1));
            assertThat(container().isPersistent(newToDo), is(true));
            assertThat(container().isPersistent(wrap(newToDo)), is(true));

            nextTransaction();

            // when
            newToDo.delete();
            nextTransaction();

            // then
            assertThat(wrap(toDoItems).notYetComplete().size(), is(size));
        }
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.