Beispiel #1
0
        public void GetMessage()
        {
            const string MESSAGE = "abcd";
            TodoModel    todo    = new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), MESSAGE);

            Assert.AreEqual(MESSAGE, todo.Message());
        }
Beispiel #2
0
        public TodoModel Create(string title, string id)
        {
            Guid _guid = Guid.Parse(id);
            DefaultEntityIdentifier <TodoModel> identifire = new DefaultEntityIdentifier <TodoModel>(typeof(TodoModel), _guid);

            return(new TodoModel(identifire, title));
        }
Beispiel #3
0
        public void CreateObject()
        {
            TodoModel todoA = new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), "");
            TodoModel todoB = new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), "");

            Assert.AreEqual(todoA, todoA.Clone());
            Assert.AreNotEqual(todoA, todoB);
        }
Beispiel #4
0
        public void ToggleStatus()
        {
            TodoModel todo = new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), "aaa");

            Assert.AreEqual(false, todo.Finished());
            todo.ToggleState();
            Assert.AreEqual(true, todo.Finished());
            todo.ToggleState();
            Assert.AreEqual(false, todo.Finished());
        }
Beispiel #5
0
        public void Store()
        {
            TodoRepository repository = new TodoRepository();

            TodoModel todoA = new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), "aaa");

            repository.Store(todoA);
            var list1 = repository.AsEntitiesList();

            TodoModel todoB = new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), "bbb");

            repository.Store(todoB);
            var list2 = repository.AsEntitiesList();

            Assert.AreEqual(1, list1.Count);
            Assert.AreEqual("aaa", list1[0].Message());
            Assert.AreEqual(2, list2.Count);
            Assert.AreEqual("bbb", list2[1].Message());
        }
Beispiel #6
0
 public TodoModel Create(string title)
 {
     return(new TodoModel(DefaultEntityIdentifier <TodoModel> .CreateNewInstance(), title));
 }