/// <summary>
        /// Setups the manager.
        /// </summary>
        private void SetTravelData()
        {
            var reservation = new DataAccess.Entities.Reservation();
            var reservationGuest = new DataAccess.Entities.ReservationGuest { BeaconId = "43", GuestId = "600001" };

            var guest = new Guest
            {
                CruiseDetail = new GuestCruiseDetail
                {
                    ////IsVip = false,
                    IsPrimary = false,
                    Stateroom = "xyz",
                    StateroomCategoryTypeId = "A",
                    ReservationStatusId = "1001",
                    ReservationNumber = "111",
                    ReservationId = "3",
                    LoyaltyLevelTypeId = "8",
                    BeaconId = "212",
                    HasRecovery = true,
                    CanDebarkAlone = false
                },
                PersonalDetail = new PersonalDetail { FirstName = "Robert", Gender = Gender.Male, },
                GuestId = "600001",
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23"
            };

            var portDebarkAuthorization = new PortDebarkAuthorization();

            var alert = new Collection<Alert> { new Alert { AlertId = "12", AlertType = "2", Message = new Message { Description = "Test", ImageAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23", Subject = "Test" } } };

            var debarkAuthorizedPersonCollection = new DebarkAuthorizedPersonCollection { new DebarkAuthorizedPerson { PersonId = "22", PersonTypeId = "323" } };

            portDebarkAuthorization.AssignDebarkAuthorizedPersons(debarkAuthorizedPersonCollection);

            var portDebarkAuthorizations = new PortDebarkAuthorizationCollection { new PortDebarkAuthorization { CanDebarkAlone = true } };

            guest.AssignAlerts(alert);
            guest.AssignPortAuthorizations(portDebarkAuthorizations);

            this.guests.Add(guest);
            var guestList = new ListResult<Guest>();
            guestList.AssignItems(this.guests);

            reservation.TravelPartyReservationIds.Add("600001");
            reservation.TravelPartyReservationIds.Add("xyz");
            reservation.ReservationGuests.Add(reservationGuest);

            this.reservationList.Items.Add(reservation);

            this.guestRepository.Setup(data => data.GetTravelWithPartyAsync(It.IsAny<GuestSearchParameters>())).Returns(Task.FromResult(this.reservationList));
            this.personRepository.Setup(data => data.RetrieveGuest(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(guestList));
        }
        private void SetupData()
        {
            var guest = new GangwayService.Entity.Guest
            {
                CruiseDetail = new GuestCruiseDetail
                {
                    ////IsVip = false,
                    IsPrimary = false,
                    Stateroom = "1",
                    StateroomCategoryTypeId = "A",
                    ReservationStatusId = "1001",
                    ReservationNumber = "111",
                    ReservationId = "3",
                    LoyaltyLevelTypeId = "8",
                    BeaconId = "212",
                    HasRecovery = true,
                    CanDebarkAlone = false,
                    StateroomOccupancy = "5"
                },
                PersonalDetail = new PersonalDetail
                {
                    FirstName = "Robert",
                    Gender = Gender.Male,
                    Birthdate = DateTime.Now,
                    Suffix = "MR.",
                    AnniversaryDate = DateTime.Now,
                    BirthCountryId = "2",
                    CitizenshipCountryId = "232",
                    LastName = "Singh",
                    MaritalStatus = "Single"
                },
                GuestId = "600001",
                LastDateTime = DateTime.Now.AddMinutes(5),
                LastEvent = "True",
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23"
            };

            var guest1 = new GangwayService.Entity.Guest
            {
                CruiseDetail = new GuestCruiseDetail
                {
                    ////IsVip = false,
                    IsPrimary = false,
                    Stateroom = "121",
                    StateroomCategoryTypeId = "A",
                    ReservationStatusId = "1001",
                    ReservationNumber = "111",
                    ReservationId = "3",
                    LoyaltyLevelTypeId = "8",
                    BeaconId = "212",
                    HasRecovery = true,
                    CanDebarkAlone = false,
                    StateroomOccupancy = "5"
                },
                PersonalDetail = new PersonalDetail
                {
                    FirstName = "Robert",
                    Gender = Gender.Male,
                    Birthdate = DateTime.Now,
                    Suffix = "MR.",
                    AnniversaryDate = DateTime.Now,
                    BirthCountryId = "2",
                    CitizenshipCountryId = "232",
                    LastName = "Singh",
                    MaritalStatus = "Single"
                },
                GuestId = "600001",
                LastDateTime = DateTime.Now.AddMinutes(5),
                LastEvent = "True",
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23"
            };

            var guest2 = new GangwayService.Entity.Guest
            {
                CruiseDetail = new GuestCruiseDetail
                {
                    ////IsVip = false,
                    IsPrimary = false,
                    Stateroom = "2",
                    StateroomCategoryTypeId = "A",
                    ReservationStatusId = "1001",
                    ReservationNumber = "111",
                    ReservationId = "3",
                    LoyaltyLevelTypeId = "8",
                    BeaconId = "212",
                    HasRecovery = true,
                    CanDebarkAlone = false,
                    StateroomOccupancy = "5"
                },
                PersonalDetail = new PersonalDetail
                {
                    FirstName = "Robert",
                    Gender = Gender.Male,
                    Birthdate = DateTime.Now,
                    Suffix = "MR.",
                    AnniversaryDate = DateTime.Now,
                    BirthCountryId = "2",
                    CitizenshipCountryId = "232",
                    LastName = "Singh",
                    MaritalStatus = "Single"
                },
                GuestId = "600001",
                LastDateTime = DateTime.Now.AddMinutes(5),
                LastEvent = "True",
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23"
            };

            var guest3 = new GangwayService.Entity.Guest
            {
                PersonalDetail = new PersonalDetail
                {
                    FirstName = "Robert",
                    Gender = Gender.Male,
                    Birthdate = DateTime.Now,
                    Suffix = "MR.",
                    AnniversaryDate = DateTime.Now,
                    BirthCountryId = "2",
                    CitizenshipCountryId = "232",
                    LastName = "Singh",
                    MaritalStatus = "Single"
                },
                GuestId = "600001",
                LastDateTime = DateTime.Now.AddMinutes(5),
                LastEvent = "True",
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23"
            };

            var crew = new DataAccess.Entities.Crewmember
            {
                CrewmemberId = "212",
                CrewmemberTypeId = "21",
                EmployeeNo = "22",
                StateroomId = "1",
                PersonalDetail = new PersonalDetail
                {
                    FirstName = "Robert"
                },
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23",
                EmbarkDetail = new EmbarkDetail { AshoreDate = DateTime.Now, OnboardDate = DateTime.Now }
            };

            var safetyDuty = new SafetyDuty
            {
                CrewmemberId = "212",
                SafetyRoleId = "1",
                EndDate = DateTime.Now,
                StartDate = DateTime.Now
            };

            var accessCard = new AccessCard { AccessCardId = "1", AddedDate = DateTime.Now, AccessCardNumber = "1234", ExpiryDate = DateTime.Now.AddDays(1) };
            crew.CrewmemberAccessCards.Add(accessCard);

            var identification = new Identification { DocumentTypeId = "1", Number = "12345" };
            crew.Identifications.Add(identification);

            var crewMemberRole = new CrewmemberRole { RoleId = "1" };
            crew.CrewmemberRoles.Add(crewMemberRole);

            crew.SafetyDuties.Add(safetyDuty);
            var visitor = new GangwayService.Entity.Visitor
            {
                HasAlert = true,
                PersonalDetail = new PersonalDetail
                {
                    DepartmentId = "1",
                    DepartmentName = "TesT",
                    FirstName = "Robert",
                    Gender = Gender.Male,
                    DepartmentPOC = "Test"
                },
                SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23",
                VisitorId = "22",
                VisitorTypeId = "21",
                VisitorInfo = new AdditionalInfo
                {
                    CompanyName = "234dfgfd",
                    ContactNumber = "23452456",
                    VisitPurpose = "retsrt"
                }
            };

            var portDebarkAuthorization = new PortDebarkAuthorization();

            var alert = new Collection<GangwayService.Entity.Alert> { new GangwayService.Entity.Alert { AlertId = "12", AlertType = "2", Message = new Message { Description = "Test", ImageAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23", Subject = "Test" } } };
            var message = new Collection<GangwayService.Entity.PersonMessage> { new GangwayService.Entity.PersonMessage { AddedBy = Environment.MachineName } };

            var debarkAuthorizedPersonCollection = new DebarkAuthorizedPersonCollection { new DebarkAuthorizedPerson { PersonId = "22", PersonTypeId = "2" }, new DebarkAuthorizedPerson { PersonId = "600001", PersonTypeId = "2" } };

            portDebarkAuthorization.AssignDebarkAuthorizedPersons(debarkAuthorizedPersonCollection);

            var portDebarkAuthorizations = new PortDebarkAuthorizationCollection { new PortDebarkAuthorization { CanDebarkAlone = true } };

            guest.AssignAlerts(alert);
            guest.AssignMessages(message);
            visitor.AssignAlerts(alert);

            guest.AssignPortAuthorizations(portDebarkAuthorizations);

            this.guests.Add(guest);
            this.guests.Add(guest1);
            this.guests.Add(guest2);
            this.guests.Add(guest3);
            this.crewmembers.Add(crew);
            this.visitors.Add(visitor);

            var guestList = new ListResult<GangwayService.Entity.Guest>();
            guestList.AssignItems(this.guests);
            guestList.TotalResults = this.guests.Count;

            var crewList = new ListResult<DataAccess.Entities.Crewmember>();
            crewList.AssignItems(this.crewmembers);
            crewList.TotalResults = this.crewmembers.Count;

            var visitorList = new ListResult<GangwayService.Entity.Visitor>();
            visitorList.AssignItems(this.visitors);
            visitorList.TotalResults = this.visitors.Count;

            this.personRepository.Setup(data => data.RetrieveGuest(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(guestList));
            this.personRepository.Setup(data => data.RetrieveCrew(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(crewList));
            this.personRepository.Setup(data => data.RetrieveVisitor(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(visitorList));
        }
 /// <summary>
 /// Function to assign port authorizations.
 /// </summary>
 /// <param name="portDebarkAuthorizationCollection">Collection of PortDebarkAuthorization</param>
 public void AssignPortAuthorizations(PortDebarkAuthorizationCollection portDebarkAuthorizationCollection)
 {
     this.portAuthorizations = portDebarkAuthorizationCollection.ToList();
 }
        private Person FilledPerson()
        {
            var person = new Person();
            CrewmemberCollection crewMembers = new CrewmemberCollection();
            var personDetail = new PersonalDetail { CitizenshipCountryId = string.Empty, FirstName = string.Empty, LastName = string.Empty, MiddleName = string.Empty, Title = string.Empty, PreferredName = string.Empty, MaritalStatus = string.Empty, Nickname = string.Empty, Occupation = string.Empty, DocumentNumber = string.Empty, Suffix = string.Empty };
            crewMembers.Add(new Crewmember { CrewmemberId = string.Empty, CrewmemberTypeId = "1", SecurityPhotoAddress = string.Empty, ChargeId = string.Empty, EmployeeNo = string.Empty, LastEvent = string.Empty, PersonalDetail = personDetail });
            person.AssignCrewmembers(crewMembers);

            GuestCollection guests = new GuestCollection();
            var checkInDetail = new CheckInDetail
            {
                ApplicationId = string.Empty,
                LocationId = "1",
                LocationTypeId = "1",
                MachineName = "Machine",
                Station = "station",
                UserId = "user"
            };
            var cruiseDetail = new GuestCruiseDetail
            {
                BeaconId = string.Empty,
                CheckInDetail = checkInDetail,
                LoyaltyLevelTypeId = "1",
                ReservationId = "1",
                Stateroom = stateroom,
                ReservationStatusId = "0000089",
                StateroomCategoryTypeId = "aaasad"
            };
            var guest = new Guest
            {
                GuestId = PersonId,
                PersonalDetail = personDetail,
                Age = 0,
                CruiseDetail = cruiseDetail,
                SecurityPhotoAddress = string.Empty
            };

            var cruiseDetails = new GuestCruiseDetail { BeaconId = string.Empty, BerthNumber = string.Empty, IdentificationId = string.Empty, LoyaltyLevelTypeId = string.Empty, ReservationId = string.Empty, Stateroom = stateroom };
            //// var personDetail = new PersonalDetail { CitizenshipCountryId = string.Empty, FirstName = string.Empty, LastName = string.Empty, MiddleName = string.Empty, Title = string.Empty, PreferredName = string.Empty, MaritalStatus = string.Empty, Nickname = string.Empty, Occupation = string.Empty, PassportNo = string.Empty, Suffix = string.Empty };
            var personBase = new PersonBase
            {
                IsOnHold = true,
                ChargeId = ChargeId,
                CruiseDetail = cruiseDetails,
                PersonalDetail = personDetail,
                LastEvent = string.Empty,
                PersonId = PersonId,
                SecurityPhotoAddress = string.Empty,
                Stateroom = stateroom
            };

            PortDebarkAuthorization pda = new PortDebarkAuthorization { PortId = "1", PersonId = "00001", CanDebarkAlone = true, IsActivePort = true, PortOrder = 1 };

            DebarkAuthorizedPersonCollection dapCollection = new DebarkAuthorizedPersonCollection();

            dapCollection.Add(new DebarkAuthorizedPerson { PersonTypeId = "2", Person = personBase, PersonId = PersonId, PersonType = PersonType.Guest });
            pda.AssignDebarkAuthorizedPersons(dapCollection);

            PortDebarkAuthorizationCollection portDebarkAuthorizations = new PortDebarkAuthorizationCollection();
            portDebarkAuthorizations.Add(pda);
            guest.AssignPortAuthorizations(portDebarkAuthorizations);
            guests.Add(guest);

            person.AssignGuests(guests);
            return person;
        }
 /// <summary>
 /// Assigns the debark authorized persons.
 /// </summary>
 /// <param name="portDebarkAuthorizedPersonCollection">The debark authorized person collection.</param>
 public void AssignPortDebarkAuthorizedPersons(PortDebarkAuthorizationCollection portDebarkAuthorizedPersonCollection)
 {
     this.portDebarkAuthorizedPersons = portDebarkAuthorizedPersonCollection;
 }
        private void SetUpData()
        {
            this.targetService = new PhotoService();
            this.person = new Person();
            CrewmemberCollection crewMembers = new CrewmemberCollection();
            var personDetail = new PersonalDetail { CitizenshipCountryId = string.Empty, FirstName = string.Empty, LastName = string.Empty, MiddleName = string.Empty, Title = string.Empty, PreferredName = string.Empty, MaritalStatus = string.Empty, Nickname = string.Empty, Occupation = string.Empty, DocumentNumber = string.Empty, Suffix = string.Empty };
            crewMembers.Add(new Crewmember { CrewmemberId = string.Empty, CrewmemberTypeId = "1", SecurityPhotoAddress = string.Empty, ChargeId = string.Empty, EmployeeNo = string.Empty, LastEvent = string.Empty, PersonalDetail = personDetail });
            this.person.AssignCrewmembers(crewMembers);

            GuestCollection guests = new GuestCollection();

            var checkInDetail = new CheckInDetail
            {
                ApplicationId = string.Empty,
                LocationId = "1",
                LocationTypeId = "1",
                MachineName = "Machine",
                Station = "station",
                UserId = "user"
            };
            var cruiseDetail = new GuestCruiseDetail
            {
                BeaconId = string.Empty,
                CheckInDetail = checkInDetail,
                LoyaltyLevelTypeId = "1",
                ReservationId = "1",
                Stateroom = stateroom,
                ReservationStatusId = "0000089",
                StateroomCategoryTypeId = "3"
            };

            var guest = new Guest
            {
                GuestId = PersonId,
                PersonalDetail = personDetail,
                Age = 0,
                CruiseDetail = cruiseDetail,
                SecurityPhotoAddress = string.Empty,
            };

            guests.Add(guest);

            this.person.AssignGuests(guests);

            PortDebarkAuthorization pda = new PortDebarkAuthorization { PortId = "1", PersonId = "00001", CanDebarkAlone = true, IsActivePort = true, PortOrder = 1 };

            DebarkAuthorizedPersonCollection dapCollection = new DebarkAuthorizedPersonCollection();

            dapCollection.Add(new DebarkAuthorizedPerson { PersonTypeId = "2", Person = this.FilledPerson(), PersonId = PersonId, PersonType = PersonType.Guest });
            pda.AssignDebarkAuthorizedPersons(dapCollection);

            PortDebarkAuthorizationCollection portDebarkAuthorizations = new PortDebarkAuthorizationCollection();
            portDebarkAuthorizations.Add(pda);
            guest.AssignPortAuthorizations(portDebarkAuthorizations);
            guests.Add(guest);

            this.listOfPDA.Add(pda);

            person.AssignGuests(guests);
        }