Beispiel #1
0
        public void should_always_return_true_if_task_exists()
        {
            var spec   = new ListAllServiceSpecification();
            var result = spec.IsSatisfied(new ServiceTask());

            result.Should().BeTrue();
        }
 public void should_always_return_true_if_task_exists()
 {
     var spec = new ListAllServiceSpecification();
     var result = spec.IsSatisfied(new ServiceTask());
     result.Should().BeTrue();
 }
        public void should_get_all_tasks_from_server()
        {
            var args = new ListAllTaskArgs();
            var spec = new ListAllServiceSpecification();
            var tasks = new List<ClientTask>();

            specConverter.GetQuerySpecification(args).Returns(spec);
            todoList.GetTasks(spec).Returns(tasks);

            var result = service.GetTasks(args);

            result.Should().BeEquivalentTo(tasks);
        }
Beispiel #4
0
        public void should_get_task_from_repository()
        {
            var spec = new ListAllServiceSpecification();
            var serviceTask = new ServiceTask {Id = 3};
            var serviceTasks = new List<ServiceTask>{serviceTask};
            var expectedTask = new ClientTask{Id =3 };
            var clientTasks = new List<ClientTask> { expectedTask };
            repo.GetTasks(spec).Returns(serviceTasks);
            mapper.ConvertToClient(serviceTask).Returns(expectedTask);

            var resultList = todoList.GetTasks(spec);

            resultList.Should().BeEquivalentTo(clientTasks);
        }