Example #1
0
        public void TestCreateJobAdSearch()
        {
            var ownerId = Guid.NewGuid();
            var search  = CreateJobAdSearch(1);

            _jobAdSearchAlertsCommand.CreateJobAdSearch(ownerId, search);

            AssertSearch(search, _jobAdSearchAlertsQuery.GetJobAdSearch(search.Id));
            Assert.IsNull(_jobAdSearchAlertsQuery.GetJobAdSearchAlert(search.Id));
        }
Example #2
0
        public void TestDeleteSearch()
        {
            var member = CreateMember();

            LogIn(member);

            // Save a search.

            var criteria = new JobAdSearchCriteria();

            criteria.SetKeywords(Keywords);
            var search = new JobAdSearch {
                Name = SearchName, Criteria = criteria
            };

            _jobAdSearchAlertsCommand.CreateJobAdSearch(member.Id, search);

            var gotSearch = _jobAdSearchAlertsQuery.GetJobAdSearch(search.Id);

            Assert.AreEqual(SearchName, gotSearch.Name);
            Assert.AreEqual(criteria, gotSearch.Criteria);
            Assert.IsNull(_jobAdSearchAlertsQuery.GetJobAdSearchAlert(search.Id));

            // Delete.

            AssertJsonSuccess(DeleteSearch(search.Id));

            // Check.

            Assert.IsNull(_jobAdSearchAlertsQuery.GetJobAdSearch(search.Id));
            Assert.IsNull(_jobAdSearchAlertsQuery.GetJobAdSearchAlert(search.Id));
        }