Ejemplo n.º 1
0
 protected void AssertNoView(Guid jobAdId, Guid viewerId)
 {
     Assert.IsFalse(_jobAdViewsQuery.HasViewedJobAd(viewerId, jobAdId));
     Assert.AreEqual(0, _jobAdViewsQuery.GetViewedJobAdIds(viewerId, new List <Guid> {
         jobAdId
     }).Count);
 }
Ejemplo n.º 2
0
        public void TestNoViewings()
        {
            var jobAdId = Guid.NewGuid();

            Assert.AreEqual(0, _jobAdViewsQuery.GetViewedCount(jobAdId));
            Assert.AreEqual(0, _jobAdViewsQuery.GetDistinctViewedCount(jobAdId));

            Assert.IsFalse(_jobAdViewsQuery.HasViewedJobAd(Guid.NewGuid(), jobAdId));

            Assert.AreEqual(0, _jobAdViewsQuery.GetViewedJobAdIds(Guid.NewGuid(), new[] { jobAdId }).Count);
            Assert.AreEqual(0, _jobAdViewsQuery.GetViewedJobAdIds(Guid.NewGuid()).Count);
        }
Ejemplo n.º 3
0
        public void TestAnonymous()
        {
            var employer = CreateEmployer();
            var jobAd    = employer.CreateTestJobAd();

            _jobAdsCommand.CreateJobAd(jobAd);
            _jobAdsCommand.OpenJobAd(jobAd);

            Get(HomeUrl);
            var anonymousId = GetAnonymousId();

            Assert.IsTrue(_jobAdViewsQuery.GetViewedJobAdIds(anonymousId, new[] { jobAd.Id }).CollectionEqual(new Guid[0]));
            Assert.AreEqual(0, _jobAdViewsQuery.GetViewedCount(jobAd.Id));

            // View.

            AssertJsonSuccess(Deserialize <JsonResponseModel>(Post(GetViewedUrl(jobAd.Id))));
            Assert.IsTrue(_jobAdViewsQuery.GetViewedJobAdIds(anonymousId, new[] { jobAd.Id }).CollectionEqual(new[] { jobAd.Id }));
            Assert.IsTrue(_jobAdViewsQuery.HasViewedJobAd(anonymousId, jobAd.Id));
        }
Ejemplo n.º 4
0
 private MemberJobAdView GetMemberJobAdView(IMember member, JobAd jobAd)
 {
     return(new MemberJobAdView(
                jobAd,
                _jobAdProcessingQuery.GetJobAdProcessing(jobAd),
                GetContactDetails(_employersQuery.GetEmployer(jobAd.PosterId), jobAd),
                GetEmployerCompanyName(jobAd),
                member != null && _jobAdViewsQuery.HasViewedJobAd(member.Id, jobAd.Id),
                member != null && _jobAdApplicationSubmissionsQuery.HasSubmittedApplication(member.Id, jobAd.Id),
                member != null && _jobAdFlagListsQuery.IsFlagged(member, jobAd.Id),
                member != null && _jobAdFoldersQuery.IsInMobileFolder(member, jobAd.Id)));
 }