public void GetTasksTest_VerifyExecuteCalledOnce()
        {
            var taskApiRepository = new TaskApiRepository(_mockedRestClient.Object);

            var taskList = taskApiRepository.GetTasks();

            _mockedRestClient.Verify(x => x.Execute <TaskList>(It.IsAny <IRestRequest>()), Times.Once());
        }
        public void GetTasksTest_VerifyTasksNotNull()
        {
            IRestResponse <TaskList> restResponse = new RestResponse <TaskList>();

            _mockedRestClient.Setup(x => x.Execute <TaskList>(It.IsAny <IRestRequest>())).Returns(restResponse);

            var taskApiRepository = new TaskApiRepository(_mockedRestClient.Object);

            var taskList = taskApiRepository.GetTasks();

            Assert.IsNotNull(taskList);
        }
        public void GetTasksTest_Response_Null_VerifyTaskListCountIsZero()
        {
            IRestResponse <TaskList> restResponse = null;

            _mockedRestClient.Setup(x => x.Execute <TaskList>(It.IsAny <IRestRequest>())).Returns(restResponse);

            var taskApiRepository = new TaskApiRepository(_mockedRestClient.Object);

            var taskList = taskApiRepository.GetTasks();

            Assert.IsTrue(taskList.Count == 0);
        }
        public void GetTasksTest_Response_Null_VerifyTaskListCountIsZero()
        {
            IRestResponse<TaskList> restResponse = null;

            _mockedRestClient.Setup(x => x.Execute<TaskList>(It.IsAny<IRestRequest>())).Returns(restResponse);

            var taskApiRepository = new TaskApiRepository(_mockedRestClient.Object);

            var taskList = taskApiRepository.GetTasks();

            taskList.Count.ShouldBe(0);
        }
        public void GetTasksTest_VerifyTasksNotNull()
        {
            IRestResponse<TaskList> restResponse = new RestResponse<TaskList>();

            _mockedRestClient.Setup(x => x.Execute<TaskList>(It.IsAny<IRestRequest>())).Returns(restResponse);

            var taskApiRepository = new TaskApiRepository(_mockedRestClient.Object);

            var taskList = taskApiRepository.GetTasks();

            taskList.ShouldNotBeNull();
        }
        public void GetTasksTest_VerifyExecuteCalledOnce()
        {
            var taskApiRepository = new TaskApiRepository(_mockedRestClient.Object);

            var taskList = taskApiRepository.GetTasks();

            _mockedRestClient.Verify(x => x.Execute<TaskList>(It.IsAny<IRestRequest>()), Times.Once());
        }