public void Execute_Initializes_Company_List()
        {
            // Setup
            InitializeTestEntities();

            // Act
            JobSearch search = new CreateJobSearchForUserCommand(_serviceFactory.Object).ForUserId(_user.Id).Execute();

            // Verify
            Assert.IsNotNull(search.Companies, "Company list was not initialized");
        }
        public void Execute_Returns_Created_Job_Search()
        {
            // Setup
            InitializeTestEntities();

            // Act
            JobSearch result = new CreateJobSearchForUserCommand(_serviceFactory.Object).ForUserId(_user.Id)
                               .WithName("Test Name")
                               .WithDescription("Test Desc")
                               .Execute();

            // Verify
            Assert.IsNotNull(result, "No Jobsearch was returned");
            Assert.AreEqual(_user.Id, result.User.Id, "Jobsearch had an incorrect user id value");
            Assert.AreEqual("Test Name", result.Name, "JobSearch had an incorrect name value");
            Assert.AreEqual("Test Desc", result.Description, "JobSearch had an incorrect description value");
            Assert.AreEqual(_user.Id, result.User.Id, "JobSearch had an incorrect user id value");
        }
Example #3
0
 public JobSearchController(JobSearchesByUserIdQuery jobSearchesByIdQuery,
                            JobSearchByIdQuery jobSearchByIdQuery,
                            CreateJobSearchForUserCommand createJobSearchCommand,
                            EditJobSearchCommand editJobSearchCommand,
                            OpenTasksByJobSearchQuery openTasksByJobSearchQuery,
                            EditUserCommand editUserCommand,
                            EntitySearchQuery entitySearchQuery,
                            UserByIdQuery userByIdQuery,
                            StartNextJobSearchMilestoneCommand startNextMilestoneCmd,
                            IProcess <ByJobSearchParams, JobsearchExportViewModel> exportProcess,
                            IServiceFactory serviceFactory)
 {
     _jobSearchByIdQuery        = jobSearchByIdQuery;
     _jobSearchesByUserIdQuery  = jobSearchesByIdQuery;
     _createJobSearchCommand    = createJobSearchCommand;
     _editJobSearchCommand      = editJobSearchCommand;
     _openTasksByJobSearchQuery = openTasksByJobSearchQuery;
     _editUserCommand           = editUserCommand;
     _entitySearchQuery         = entitySearchQuery;
     _serviceFactory            = serviceFactory;
     _userByIdQuery             = userByIdQuery;
     _startNextMilestoneCmd     = startNextMilestoneCmd;
     _exportProcess             = exportProcess;
 }