Esempio n. 1
0
        public void CanDeleteTodo()
        {
            const string expectedName = "go to school";

            var store = new Store();

            store.Add(new Todo("go to the gym"));
            var addedTodo = store.Add(new Todo("go to school")) as Todo;

            var controller   = new TodoController(store);
            var removeResult = controller.Remove(addedTodo.Id.ToString(), string.Empty, addedTodo.Name);
            var deletedTodo  = (removeResult.Data as TodoViewModel).Id;

            deletedTodo.Should().NotBeNull();

            store.Get <Todo>(1, 10).Should().HaveCount(1);
            store.Get <Todo>(1, 10).Should().NotContain(x => x.Name.Equals(expectedName));
        }