コード例 #1
0
        public void TestRemoveProject()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Name = "Palaksha";

            CandidateWorkProfile workProfile = new CandidateWorkProfile();

            workProfile.CompanyName = "ResumePro";
            Relation.Add(candidate, workProfile);

            candidate = SaveAndReFetch(candidate);

            workProfile = CollectionHelper.First(Relation.Collection <CandidateWorkProfile>(candidate));

            With.Transaction(delegate
            {
                //candidate.RemoveChild(project);
                Relation.Remove(candidate, workProfile);
            });

            candidate = SaveAndReFetch(candidate);

            Assert.AreEqual(Relation.Count <CandidateWorkProfile>(candidate), 0);
        }
コード例 #2
0
        public void TestAddCandidateAndWorkProfileTogether()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Name = "Mohan";

            CandidateWorkProfile workProfile = new CandidateWorkProfile();

            workProfile.CompanyName = "ResumePro";

            Relation.Add(candidate, workProfile);

            candidate.AddToWorkProfile(workProfile);

            candidate = SaveAndReFetch(candidate);

            Assert.AreEqual(Relation.Count <CandidateWorkProfile>(candidate), 1);
        }
コード例 #3
0
        public void TestUpdateProjectDirect()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Name = "Palaksha";
            CandidateWorkProfile workProfile = new CandidateWorkProfile();

            workProfile.CompanyName = "AppServer";
            Relation.Add(candidate, workProfile);

            Save(candidate);

            workProfile = Repository <CandidateWorkProfile> .FindOne(Expression.Eq("CompanyName", "AppServer"));

            workProfile.CompanyName = "Changed" + workProfile.CompanyName;

            workProfile = CollectionHelper.First(Relation.Collection <CandidateWorkProfile>(candidate));
            Assert.IsTrue(workProfile.CompanyName.StartsWith("Changed"));
        }
コード例 #4
0
        public void TestRemoveProjectDirect()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Name = "Palaksha";

            CandidateWorkProfile workProfile = new CandidateWorkProfile();

            workProfile.CompanyName = "AppServer";
            Relation.Add(candidate, workProfile);
            Save(candidate);

            workProfile = Repository <CandidateWorkProfile> .FindOne(Expression.Eq("CompanyName", "AppServer"));

            //candidate.RemoveChild(project);
            Relation.Remove(candidate, workProfile);

            SaveAndReFetch(candidate);

            Assert.AreEqual(Relation.Count <CandidateWorkProfile>(candidate), 0);
        }
コード例 #5
0
        public void TestUpdateWorkProfile()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Name = "Palaksha";

            CandidateWorkProfile workProfile = new CandidateWorkProfile();

            workProfile.CompanyName = "ResumePro";
            Relation.Add(candidate, workProfile);

            candidate = SaveAndReFetch(candidate);

            workProfile             = CollectionHelper.First(Relation.Collection <CandidateWorkProfile>(candidate));
            workProfile.CompanyName = "Changed" + workProfile.CompanyName;


            candidate = SaveAndReFetch(candidate);

            workProfile = CollectionHelper.First(Relation.Collection <CandidateWorkProfile>(candidate));
            Assert.IsTrue(workProfile.CompanyName.StartsWith("Changed"));
        }
コード例 #6
0
 public virtual void RemoveFromWorkProfile(CandidateWorkProfile workProfile)
 {
     Relation.Remove <TestCandidate, CandidateWorkProfile>(this, workProfile);
 }
コード例 #7
0
 public virtual void AddToWorkProfile(CandidateWorkProfile workProfile)
 {
     Relation.Add <TestCandidate, CandidateWorkProfile>(this, workProfile);
 }