public void StartActivity_ActivityIsNotStarted_ActivityStarted()
        {
            _unitOfWork.Setup(unitOfWork => unitOfWork.StartActivity(It.IsAny<int>()))
               .Returns(new ActivityTime());

            var controller = new ActivitiesApiController(_unitOfWork.Object);
            var response = controller.StartActivity(1);
            response.ExecuteAsync(new CancellationToken(true));

            Assert.IsTrue(response.Result != null);
        }
        public void GetAllActivities_ActivitiesExist_ResultsOK()
        {
            Mock<IGenericRepository<Activity>> repository = new Mock<IGenericRepository<Activity>>();

            repository.Setup(repo => repo.GetAll()).Returns(
                new Activity[] { new Activity() { Id =0, Name="test" } }
                );
            _unitOfWork.Setup(unitOfWork => unitOfWork.ActivityRepository)
                .Returns(repository.Object);

            var controller = new ActivitiesApiController(_unitOfWork.Object);

            var response = controller.GetAllActivities();
            response.ExecuteAsync(new CancellationToken(true));

            Assert.IsNotNull(response.Result);
        }
        public void Delete_ActivityExists_DeleteOK()
        {
            Mock<IGenericRepository<Activity>> repository = new Mock<IGenericRepository<Activity>>();

            repository.Setup(repo => repo.Delete(It.IsAny<int>()))
                .Returns(true);

            _unitOfWork.Setup(unitOfWork => unitOfWork.ActivityRepository)
                .Returns(repository.Object);

            var controller = new ActivitiesApiController(_unitOfWork.Object);

            var response = controller.Delete(2);

            response.ExecuteAsync(new CancellationToken(true));

            Assert.IsTrue(response.Result);
        }