public void CreateTest()
        {
            //Arange
            var controller = new ContractenController(_calculationsService, _unitOfWork.Object, _contractRepository.Object);

            //Act
            var result = controller.Create();

            //Assert
            var viewResult = Assert.IsType <ViewResult>(result);
        }
        public async Task DetailTestNotFound()
        {
            //Arange
            var controller = new ContractenController(_calculationsService, _unitOfWork.Object, _contractRepository.Object);

            //Act
            var result = await controller.Details(null);

            //Assert
            var contentResult = Assert.IsType <NotFoundResult>(result);
        }
        public async Task Index_ReturnsAViewResult_WithAListOfContractDTOs()
        {
            _contractRepository.Setup(repo => repo.GetAsync()).Returns(Task.FromResult(GetContracts()));
            var controller = new ContractenController(_calculationsService, _unitOfWork.Object, _contractRepository.Object);

            //Act
            var result = await controller.Index();

            //Assert
            var viewResult = Assert.IsType <ViewResult>(result);
            var model      = Assert.IsAssignableFrom <IEnumerable <ContractDTO> >(
                viewResult.ViewData.Model);

            Assert.Equal(4, model.Count());
        }
        public async Task Detail_ReturnsAViewResult_WithAContractDTO()
        {
            //Arrange
            var contractID = 1;

            ContractDTO contract      = (GetContracts().FirstOrDefault(m => m.ContractID == contractID));
            var         medewerkers   = GetMedewerkers();
            var         medewerkerDTO = new MedewerkerDTO(medewerkers[1]);

            contract.medewerker = medewerkerDTO;

            _contractRepository.Setup(repo => repo.GetByIdAsync(contractID)).Returns(Task.FromResult(contract));
            var controller = new ContractenController(_calculationsService, _unitOfWork.Object, _contractRepository.Object);

            //Act
            var result = await controller.Details(contractID);

            //Assert
            var viewResult = Assert.IsType <ViewResult>(result);
            var model      = Assert.IsType <ContractDTO>(
                viewResult.ViewData.Model);

            Assert.Equal(1, model.ContractID);
        }