private void SetUpIncidentPersonOther() { var incidentPersonOther = new PublicSafetyPerson(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); _summariesUnitOfWork.Setup(mock => mock.Find <PublicSafetyPerson>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())) .Returns(incidentPersonOther); _incidentSummary.People.Add(incidentPersonOther); _incidentPersonOtherId = incidentPersonOther.Id; }
public void SetUp() { baseCollection = new PublicSafetyPerson(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()); baseCollection.LastName = "data"; baseCollection.FirstName = "data1"; lst = new List <PublicSafetyPerson>(); lst.Add(baseCollection); derivedCollectionObj = new DerivedCollection <FieldInterviewSource, PublicSafetyPerson>(lst); }
public void FindIncidentPersonOther() { var incidentPersonOther = new PublicSafetyPerson(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); _reportsUnitOfWork.Setup(mock => mock.Find <PublicSafetyPerson>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())).Returns(incidentPersonOther); var incidentPersonOtherReport = _incidentReportQueryService.FindIncidentPersonOther(It.IsAny <Guid>()); incidentPersonOtherReport.Should().NotBeNull(); }
public void FindIncidentPersonOtherReportId() { var incidentPersonOther = new PublicSafetyPerson(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); _incidentReport.People.Add(incidentPersonOther); var incidentPersonOtherReportId = _incidentReportQueryService.FindIncidentPersonOtherReportId(incidentPersonOther.Id); incidentPersonOtherReportId.Should().NotBeEmpty(); Assert.AreEqual(_incidentReport.Id, incidentPersonOtherReportId); }
private void SetUpReport() { var arrestReport = new ArrestReport(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid(), false); var reportList = new List <Report>(); var person = new PublicSafetyPerson(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()); person.MasterPersonId = MasterPersonId; arrestReport.People.Add(person); reportList.Add(arrestReport); _reportsUnitOfWork.Setup(mock => mock.GetEntityQuery <Report>(It.IsAny <TrackingMode>())).Returns(reportList.AsQueryable()); }
private void SetUpSummary() { var summaryList = new List <Summary>(); var summary = new SummaryDerived(Guid.NewGuid(), Guid.NewGuid(), It.IsAny <Guid>(), ModuleType.Arrest, "123", null); var person = new PublicSafetyPerson(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()); person.MasterPersonId = MasterPersonId; summary.People.Add(person); summaryList.Add(summary); _summariesUnitOfWork.Setup(mock => mock.GetEntityQuery <Summary>(It.IsAny <TrackingMode>())).Returns(summaryList.AsQueryable); }
/// <summary> /// Attempts to add the specified Subject to the collection of People. If a Subject has already /// been specified, an exception is thrown. /// </summary> public void AddSubject(PublicSafetyPerson subject) { // There can be only one Subject of a Citation. if (People.Any(x => CodeValue.ValuesMatch(x.InvolvementType, CitationPersonInvolvementTypes.Subject))) { throw new Exception("A Subject already exists on this Citation."); } // Make sure the Involvment Type is Correct subject.InvolvementType = CitationPersonInvolvementTypes.Subject; // Add the Subject to the Collection of People on the this Citation. People.Add(subject); }
public void FindCallForServicePerson() { //Arrange var PublicSafetyPerson = new PublicSafetyPerson(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); summariesUnitOfWork.Setup(mock => mock.Find <PublicSafetyPerson>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())).Returns(PublicSafetyPerson); //Act var result = callForServiceSummaryQueryService.FindCallForServicePerson(It.IsAny <Guid>()); //Assert result.Should().NotBeNull(); result.Id.Should().NotBeEmpty(); }
public void GetRelatedNames() { var incidentOrganization = new PublicSafetyOrganization(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); var incidentPersonSuspect = new PublicSafetyPerson(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); _report.People.Add(incidentPersonSuspect); _report.Organizations.Add(incidentOrganization); _summary.People.Add(incidentPersonSuspect); _summary.Organizations.Add(incidentOrganization); var relatedNames = _relatedToService.GetRelatedNames(_report.Number, _report.AgencyId, _report.ModuleType); relatedNames.Should().NotBeEmpty(); relatedNames.Should().HaveCount(4); relatedNames.Should().BeOfType(typeof(List <RelatedName>)); _reportsUnitOfWork.VerifyAll(); _summariesUnitOfWork.VerifyAll(); }
public void ProcessMasterIndexes_Person_AsEntity() { _scarMarkTattooProcessor.Setup(mock => mock.Process(It.IsAny <ScarMarkTattoo>(), It.IsAny <PublicSafetyPerson>())); _addressProcessor.Setup(mock => mock.Process(It.IsAny <Location>())); _nameProcessor.Setup(mock => mock.Process(It.IsAny <PublicSafetyPerson>())); PublicSafetyPerson entity = new PublicSafetyPerson(Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid()); entity.ScarsMarksTattoos = new ScarMarkTattooCollection() { new ScarMarkTattoo() { Description = "desc", Active = "Active" } }; masterIndexServiceObj.ProcessMasterIndexes <PublicSafetyPerson>(entity); _nameProcessor.VerifyAll(); _addressProcessor.VerifyAll(); _scarMarkTattooProcessor.VerifyAll(); }
public void AddOther(PublicSafetyPerson other) { People.Add(other); }
private void SetUpIncidentPersonOther() { _incidentPersonOther = new PublicSafetyPerson(DataEntryUnitTestFixture.IdentityId, DataEntryUnitTestFixture.AgencyDetails.Id, Guid.NewGuid()); _reportsUnitOfWork.Setup(mock => mock.Find <PublicSafetyPerson>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())) .Returns(_incidentPersonOther); }