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); }
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); }
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")); }
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); }
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")); }
public virtual void RemoveFromWorkProfile(CandidateWorkProfile workProfile) { Relation.Remove <TestCandidate, CandidateWorkProfile>(this, workProfile); }
public virtual void AddToWorkProfile(CandidateWorkProfile workProfile) { Relation.Add <TestCandidate, CandidateWorkProfile>(this, workProfile); }