Example #1
0
        public void GetApplication_ApplicationExists_JobApplication()
        {
            // Arrange
            const string companyName            = "Company 1";
            var          jobApplicationEntities = (IEnumerable <JobApplicationEntity>)_jobApplicationEntities;
            var          jobApplicationEntity   = jobApplicationEntities.First(x => x.CompanyName.Equals(companyName));

            _jobApplicationRepository.GetOne(Arg.Any <Expression <Func <JobApplicationEntity, bool> > >()).Returns(jobApplicationEntity);
            _mapper.Map <JobApplication>(jobApplicationEntity).Returns(_jobApplications[0]);
            _userResolver.GetCurrentUser().Returns(_user);

            // Act
            var result = _jobApplicationService.GetApplication(companyName);

            // Assert
            Assert.Equal(_jobApplications[0], result);
        }