Пример #1
0
        public void UserTest()
        {
            IUserDatabase database = new MyUserDatabase();

            IUser george = database.GetUser("george", "monkey!");

            Assert.IsNotNull(george);
            Assert.AreEqual("george", george.UserName);
        }
Пример #2
0
        public void TaskTest()
        {
            IUserDatabase userDb = new MyUserDatabase();
            IUser         george = userDb.GetUser("george", "monkey!");

            ITaskDatabase database = new MyTaskDatabase();

            ITask task = database.NewTask();

            task.AssignedTo = george;
            task.Title      = "George's task";
            database.SaveTask(task);

            var tasks = database.GetTasks(george);

            Assert.Greater(tasks.Count(), 0);
            Assert.AreEqual(george, tasks.First().AssignedTo);
        }