Package dom.todo

Examples of dom.todo.ToDoItem


        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);
            checking(new Expectations() {
                {
                    allowing(bulkInteractionContext);
                }
            });
            toDoItem.injectBulkInteractionContext(bulkInteractionContext);
        }
        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

        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

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

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

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

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

        // and then
        @SuppressWarnings("unchecked")
        final CollectionAddedToEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionAddedToEvent.class);
        assertThat(ev, is(not(nullValue())));
       
        ToDoItem source = ev.getSource();
        assertThat(source, is(equalTo(unwrap(toDoItem))));
        assertThat(ev.getIdentifier().getMemberName(), is("dependencies"));
        assertThat(ev.getValue(), is(unwrap(otherToDoItem)));
    }
View Full Code Here

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

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

       
        // 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));
    }
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

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.