Esempio n. 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);
        }
Esempio n. 2
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"));
        }
Esempio n. 3
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"));
        }
Esempio n. 4
0
        public void TestAddCandidateAndWorkProfileAndProject()
        {
            TestCandidate candidate = new TestCandidate();

            candidate.Name = "Mohan";

            CandidateWorkProfile workProfile;

            Relation.AddNew(candidate, out workProfile);
            workProfile.CompanyName = "HirePro";

            CandidateProject project = new CandidateProject();

            project.Name = "ResumePro";
            Relation.Add(workProfile, project);

            candidate = SaveAndReFetch(candidate);

            Assert.AreEqual(Relation.Count <CandidateWorkProfile>(candidate), 1);
            Assert.AreEqual(Relation.Count <CandidateProject>(workProfile), 1);
            Assert.AreEqual(
                CollectionHelper.First(Relation.Collection <CandidateProject>(workProfile)).Name,
                "ResumePro");
        }