public void CRUD_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var soln = Retriever.GetAllSolutions(_policy).First(); var std = Retriever.GetAllStandards(_policy).First(); var datastore = new StandardsApplicableDatastore(DatastoreBaseSetup.StandardsApplicableDatastore, _logger, _policy); // create var newEnt = Creator.GetStandardsApplicable(solnId: soln.Id, claimId: std.Id, ownerId: contact.Id); var createdEnt = datastore.Create(newEnt); try { createdEnt.Should().BeEquivalentTo(newEnt); // update createdEnt.Status = StandardsApplicableStatus.Submitted; datastore.Update(createdEnt); // retrieve datastore.ById(createdEnt.Id) .Should().BeEquivalentTo(createdEnt); } finally { // delete datastore.Delete(createdEnt); } // delete datastore.ById(createdEnt.Id) .Should().BeNull(); }
public void CRUD_Succeeds() { var contact = Retriever.GetAllContacts(_policy).First(); var soln = Retriever.GetAllSolutions(_policy).First(); var cap = Retriever.GetAllCapabilities(_policy).First(); var datastore = new CapabilitiesImplementedDatastore(DatastoreBaseSetup.CapabilitiesImplementedDatastore, _logger, _policy); // create var newEnt = Creator.GetCapabilitiesImplemented(solnId: soln.Id, claimId: cap.Id, ownerId: contact.Id); var createdEnt = datastore.Create(newEnt); try { createdEnt.Should().BeEquivalentTo(newEnt); // update createdEnt.Status = CapabilitiesImplementedStatus.Submitted; datastore.Update(createdEnt); // retrieve datastore.ById(createdEnt.Id) .Should().BeEquivalentTo(createdEnt); } finally { // delete datastore.Delete(createdEnt); } // delete datastore.ById(createdEnt.Id) .Should().BeNull(); }
public void BySolution_ReturnsData() { var allSolns = Retriever.GetAllSolutions(_policy); var ids = allSolns.Select(soln => soln.Id).Distinct().ToList(); var datastore = new StandardsApplicableDatastore(DatastoreBaseSetup.StandardsApplicableDatastore, _logger, _policy); var datas = ids.SelectMany(id => datastore.BySolution(id)).ToList(); datas.Should().NotBeEmpty(); datas.ForEach(data => data.Should().NotBeNull()); datas.ForEach(data => Verifier.Verify(data)); }
public void BySolution_ReturnsData() { var allSolns = Retriever.GetAllSolutions(_policy); var ids = allSolns.Select(soln => soln.Id).Distinct().ToList(); var datastore = new CapabilitiesImplementedDatastore(DatastoreBaseSetup.CrmConnectionFactory, _logger, _policy, _config); var datas = ids.SelectMany(id => datastore.BySolution(id)).ToList(); datas.Should().NotBeEmpty(); datas.ForEach(data => data.Should().NotBeNull()); datas.ForEach(data => Verifier.Verify(data)); }