public void Update_ClaimedCapabilityReview_Add_EndChain_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var cap = Retriever.GetAllCapabilities(_policy).First(); var claim = Creator.GetCapabilitiesImplemented(claimId: cap.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedCapability(); _solnEx.ClaimedCapability.Add(claim); var contId = GetContact().Id; var evidence = Creator.GetCapabilitiesImplementedEvidence(claimId: claim.Id, createdById: contId); var reviewPrev = Creator.GetCapabilitiesImplementedReviews(evidenceId: evidence.Id, createdById: contId); _solnEx.ClaimedCapabilityEvidence.Add(evidence); _solnEx.ClaimedCapabilityReview.Add(reviewPrev); _datastore.Update(_solnEx); var review = Creator.GetCapabilitiesImplementedReviews(prevId: reviewPrev.Id, evidenceId: evidence.Id, createdById: contId); _solnEx.ClaimedCapabilityReview.Add(review); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedCapabilityReview .Should().HaveCount(2) .And.Subject .Should().BeEquivalentTo(new[] { review, reviewPrev }, opts => opts .Excluding(ent => ent.CreatedOn)); }
public void Update_ClaimedStandardReview_Remove_EndChain_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var std = Retriever.GetAllStandards(_policy).First(); var claim = Creator.GetStandardsApplicable(claimId: std.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedStandard(); _solnEx.ClaimedStandard.Add(claim); var contId = GetContact().Id; var evidence = Creator.GetStandardsApplicableEvidence(claimId: claim.Id, createdById: contId); var reviewPrev = Creator.GetStandardsApplicableReviews(evidenceId: evidence.Id, createdById: contId); var review = Creator.GetStandardsApplicableReviews(prevId: reviewPrev.Id, evidenceId: evidence.Id, createdById: contId); _solnEx.ClaimedStandardEvidence.Add(evidence); _solnEx.ClaimedStandardReview.Add(reviewPrev); _solnEx.ClaimedStandardReview.Add(review); _datastore.Update(_solnEx); _solnEx.ClaimedStandardReview.Remove(review); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedStandardReview .Should().ContainSingle() .And.Subject.Single() .Should().BeEquivalentTo(reviewPrev, opts => opts .Excluding(ent => ent.CreatedOn)); }
public void Update_ClaimedCapabilityEvidence_Remove_EndChain_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var cap = Retriever.GetAllCapabilities(_policy).First(); var claim = Creator.GetCapabilitiesImplemented(claimId: cap.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedCapability(); _solnEx.ClaimedCapability.Add(claim); var contId = GetContact().Id; var evidencePrev = Creator.GetCapabilitiesImplementedEvidence(claimId: claim.Id, createdById: contId); var evidence = Creator.GetCapabilitiesImplementedEvidence(prevId: evidencePrev.Id, claimId: claim.Id, createdById: contId); _solnEx.ClaimedCapabilityEvidence.Add(evidence); _solnEx.ClaimedCapabilityEvidence.Add(evidencePrev); _datastore.Update(_solnEx); _solnEx.ClaimedCapabilityEvidence.Remove(evidence); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedCapabilityEvidence .Should().ContainSingle() .And.Subject.Single() .Should().BeEquivalentTo(evidencePrev, opts => opts .Excluding(ent => ent.CreatedOn)); }
public void Update_ClaimedStandardEvidence_Add_EndChain_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var std = Retriever.GetAllStandards(_policy).First(); var claim = Creator.GetStandardsApplicable(claimId: std.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedStandard(); _solnEx.ClaimedStandard.Add(claim); var contId = GetContact().Id; var evidencePrev = Creator.GetStandardsApplicableEvidence(claimId: claim.Id, createdById: contId); _solnEx.ClaimedStandardEvidence.Add(evidencePrev); _datastore.Update(_solnEx); var evidence = Creator.GetStandardsApplicableEvidence(prevId: evidencePrev.Id, claimId: claim.Id, createdById: contId); _solnEx.ClaimedStandardEvidence.Add(evidence); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedStandardEvidence .Should().HaveCount(2) .And.Subject .Should().BeEquivalentTo(new[] { evidence, evidencePrev }, opts => opts .Excluding(ent => ent.CreatedOn)); }
public void Update_ClaimedStandardReview_Remove_Chain_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var std = Retriever.GetAllStandards(_policy).First(); var claim = Creator.GetStandardsApplicable(claimId: std.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedStandard(); _solnEx.ClaimedStandard.Add(claim); var contId = GetContact().Id; var evidence = Creator.GetStandardsApplicableEvidence(claimId: claim.Id, createdById: contId); var reviewPrev = Creator.GetStandardsApplicableReviews(evidenceId: evidence.Id, createdById: contId); var review = Creator.GetStandardsApplicableReviews(prevId: reviewPrev.Id, evidenceId: evidence.Id, createdById: contId); _solnEx.ClaimedStandardEvidence.Add(evidence); _solnEx.ClaimedStandardReview.Add(reviewPrev); _solnEx.ClaimedStandardReview.Add(review); _datastore.Update(_solnEx); _solnEx.ClaimedStandardReview.Clear(); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedStandardReview .Should().BeEmpty(); }
public void Update_ClaimedCapabilityReview_Remove_Chain_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var cap = Retriever.GetAllCapabilities(_policy).First(); var claim = Creator.GetCapabilitiesImplemented(claimId: cap.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedCapability(); _solnEx.ClaimedCapability.Add(claim); var contId = GetContact().Id; var evidence = Creator.GetCapabilitiesImplementedEvidence(claimId: claim.Id, createdById: contId); var reviewPrev = Creator.GetCapabilitiesImplementedReviews(evidenceId: evidence.Id, createdById: contId); var review = Creator.GetCapabilitiesImplementedReviews(prevId: reviewPrev.Id, evidenceId: evidence.Id, createdById: contId); _solnEx.ClaimedCapabilityEvidence.Add(evidence); _solnEx.ClaimedCapabilityReview.Add(reviewPrev); _solnEx.ClaimedCapabilityReview.Add(review); _datastore.Update(_solnEx); _solnEx.ClaimedCapabilityReview.Clear(); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedCapabilityReview .Should().BeEmpty(); }
public void Update_ClaimedStandard_Add_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var std = Retriever.GetAllStandards(_policy).First(); var claim = Creator.GetStandardsApplicable(claimId: std.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedStandard(); _solnEx.ClaimedStandard.Add(claim); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedStandard .Should().ContainSingle() .And.Subject.Single() .Should().BeEquivalentTo(claim); }
public void Update_ClaimedCapability_Add_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var cap = Retriever.GetAllCapabilities(_policy).First(); var claim = Creator.GetCapabilitiesImplemented(claimId: cap.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedCapability(); _solnEx.ClaimedCapability.Add(claim); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedCapability .Should().ContainSingle() .And.Subject .Should().BeEquivalentTo(claim); }
public void Update_ClaimedStandard_Remove_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var std = Retriever.GetAllStandards(_policy).First(); var claim = Creator.GetStandardsApplicable(claimId: std.Id, solnId: _solnEx.Solution.Id, ownerId: contact.Id); ClearClaimedStandard(); _solnEx.ClaimedStandard.Add(claim); _datastore.Update(_solnEx); _solnEx.ClaimedStandard.Clear(); _datastore.Update(_solnEx); var retrievedSolnEx = _datastore.BySolution(_solnEx.Solution.Id); retrievedSolnEx.ClaimedStandard .Should().BeEmpty(); }
private Contacts GetContact() { return Retriever.GetAllContacts(_policy).First(); }