Ejemplo n.º 1
0
        public override int GetHashCode()
        {
            int result = 1;

            result = (result * 397) ^ (AltEmailAddress != null ? AltEmailAddress.GetHashCode() : 0);
            result = (result * 397) ^ (AltTelephoneContact != null ? AltTelephoneContact.GetHashCode() : 0);
            result = (result * 397) ^ (CreatedOn != null ? CreatedOn.GetHashCode() : 0);
            result = (result * 397) ^ (DateOfBirth != null ? DateOfBirth.GetHashCode() : 0);
            result = (result * 397) ^ (EmailAddress != null ? EmailAddress.GetHashCode() : 0);
            result = (result * 397) ^ (Gender != null ? Gender.GetHashCode() : 0);
            result = (result * 397) ^ (GivenName != null ? GivenName.GetHashCode() : 0);
            result = (result * 397) ^ (HomeLanguage != null ? HomeLanguage.GetHashCode() : 0);
            result = (result * 397) ^ Id.GetHashCode();
            result = (result * 397) ^ (LastModified != null ? LastModified.GetHashCode() : 0);
            result = (result * 397) ^ (MaritalStatus != null ? MaritalStatus.GetHashCode() : 0);
            result = (result * 397) ^ (NextOfKinAddress != null ? NextOfKinAddress.GetHashCode() : 0);
            result = (result * 397) ^ (NextOfKinContact != null ? NextOfKinContact.GetHashCode() : 0);
            result = (result * 397) ^ (NextOfKinName != null ? NextOfKinName.GetHashCode() : 0);
            result = (result * 397) ^ (NextOfKinRelationship != null ? NextOfKinRelationship.GetHashCode() : 0);
            result = (result * 397) ^ (Occupation != null ? Occupation.GetHashCode() : 0);
            result = (result * 397) ^ (Organisation != null ? Organisation.GetHashCode() : 0);
            result = (result * 397) ^ (OtherName != null ? OtherName.GetHashCode() : 0);
            result = (result * 397) ^ (PermentAddress != null ? PermentAddress.GetHashCode() : 0);
            result = (result * 397) ^ (PersonOwnerType != null ? PersonOwnerType.GetHashCode() : 0);
            result = (result * 397) ^ (PlaceOfBirth != null ? PlaceOfBirth.GetHashCode() : 0);
            result = (result * 397) ^ (PostalAddress != null ? PostalAddress.GetHashCode() : 0);
            result = (result * 397) ^ (PreferredLanguage != null ? PreferredLanguage.GetHashCode() : 0);
            result = (result * 397) ^ (ProfilePhotoName != null ? ProfilePhotoName.GetHashCode() : 0);
            result = (result * 397) ^ (Religion != null ? Religion.GetHashCode() : 0);
            result = (result * 397) ^ (Surname != null ? Surname.GetHashCode() : 0);
            result = (result * 397) ^ (TelephoneContact != null ? TelephoneContact.GetHashCode() : 0);
            result = (result * 397) ^ (Title != null ? Title.GetHashCode() : 0);
            result = (result * 397) ^ (WebsiteUrl != null ? WebsiteUrl.GetHashCode() : 0);
            return(result);
        }
Ejemplo n.º 2
0
 public OtherNameViewModel(OtherName otherName)
 {
     this.Id       = otherName.Id;
     this.Language = otherName.TitleNameLanguage;
     this.NameType = otherName.TitleNameType;
     this.Name     = otherName.TitleNameSortable;
 }
Ejemplo n.º 3
0
        public void OtherNameQueryUsingoAuth()
        {
            QueryService <OtherName> entityQuery = new QueryService <OtherName>(qboContextoAuth);
            OtherName        existing            = Helper.FindOrAdd <OtherName>(qboContextoAuth, new OtherName());
            List <OtherName> entities            = entityQuery.Where(c => c.Id == existing.Id).ToList();

            Assert.IsTrue(entities.Count() > 0);
        }
Ejemplo n.º 4
0
        public void OtherNameQueryUsingoAuth()
        {
            QueryService <OtherName> entityQuery = new QueryService <OtherName>(qboContextoAuth);
            OtherName existing = Helper.FindOrAdd <OtherName>(qboContextoAuth, new OtherName());
            int       count    = entityQuery.ExecuteIdsQuery("Select * from OtherName where Id='" + existing.Id + "'").Count;

            Assert.IsTrue(count > 0);
        }
Ejemplo n.º 5
0
        public void OtherNameVoidAsyncTestsUsingoAuth()
        {
            //Creating the OtherName for Adding
            OtherName entity = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the OtherName
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, entity);

            Helper.VoidAsync <OtherName>(qboContextoAuth, added);
        }
Ejemplo n.º 6
0
        public void OtherNameAddAsyncTestsUsingoAuth()
        {
            //Creating the OtherName for Add
            OtherName entity = QBOHelper.CreateOtherName(qboContextoAuth);

            OtherName added = Helper.AddAsync <OtherName>(qboContextoAuth, entity);

            QBOHelper.VerifyOtherName(entity, added);
        }
 public static PersonOtherName ToEntity(this OtherName name, long personId, string createdBy)
 {
     return(new PersonOtherName
     {
         FirstName = name.FirstName,
         LastName = name.LastName,
         PersonId = personId,
         CreatedBy = createdBy
     });
 }
Ejemplo n.º 8
0
        public void OtherNameFindbyIdTestUsingoAuth()
        {
            //Creating the OtherName for Adding
            OtherName otherName = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the OtherName
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, otherName);
            OtherName found = Helper.FindById <OtherName>(qboContextoAuth, added);

            QBOHelper.VerifyOtherName(found, added);
        }
Ejemplo n.º 9
0
        public void OtherNameAddTestUsingoAuth()
        {
            //Creating the OtherName for Add
            OtherName otherName = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the OtherName
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, otherName);

            //Verify the added OtherName
            QBOHelper.VerifyOtherName(otherName, added);
        }
        public void CanMapPersonOtherNameFromDatabaseObjectToDomainObject()
        {
            PersonOtherName otherName = DatabaseGatewayHelper.CreatePersonOtherNameDatabaseEntity(_faker.Random.Long());

            var expectedResponse = new OtherName()
            {
                FirstName = otherName.FirstName,
                LastName  = otherName.LastName
            };

            otherName.ToDomain().Should().BeEquivalentTo(expectedResponse);
        }
Ejemplo n.º 11
0
        public void OtherNameUpdateTestUsingoAuth()
        {
            //Creating the OtherName for Adding
            OtherName otherName = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the OtherName
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, otherName);
            //Change the data of added entity
            OtherName changed = QBOHelper.UpdateOtherName(qboContextoAuth, added);
            //Update the returned entity data
            OtherName updated = Helper.Update <OtherName>(qboContextoAuth, changed);//Verify the updated OtherName

            QBOHelper.VerifyOtherName(changed, updated);
        }
Ejemplo n.º 12
0
        public void OtherNameUpdatedAsyncTestsUsingoAuth()
        {
            //Creating the OtherName for Adding
            OtherName entity = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the OtherName
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, entity);

            //Update the OtherName
            OtherName updated = QBOHelper.UpdateOtherName(qboContextoAuth, added);
            //Call the service
            OtherName updatedReturned = Helper.UpdateAsync <OtherName>(qboContextoAuth, updated);

            //Verify updated OtherName
            QBOHelper.VerifyOtherName(updated, updatedReturned);
        }
Ejemplo n.º 13
0
        public void OtherNameDeleteTestUsingoAuth()
        {
            //Creating the OtherName for Adding
            OtherName otherName = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the OtherName
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, otherName);

            //Delete the returned entity
            try
            {
                OtherName deleted = Helper.Delete <OtherName>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Deleted, deleted.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
Ejemplo n.º 14
0
        public void OtherNameVoidTestUsingoAuth()
        {
            //Creating the entity for Adding
            OtherName entity = QBOHelper.CreateOtherName(qboContextoAuth);
            //Adding the entity
            OtherName added = Helper.Add <OtherName>(qboContextoAuth, entity);

            //Void the returned entity
            try
            {
                OtherName voided = Helper.Void <OtherName>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Voided, voided.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
Ejemplo n.º 15
0
        public void OtherNameBatchUsingoAuth()
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

            OtherName existing = Helper.FindOrAdd(qboContextoAuth, new OtherName());

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateOtherName(qboContextoAuth));

            batchEntries.Add(OperationEnum.update, QBOHelper.UpdateOtherName(qboContextoAuth, existing));

            batchEntries.Add(OperationEnum.query, "select * from OtherName");

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.BatchTest <OtherName>(qboContextoAuth, batchEntries);

            int position = 0;

            foreach (IntuitBatchResponse resp in batchResponses)
            {
                if (resp.ResponseType == ResponseType.Exception)
                {
                    Assert.Fail(resp.Exception.ToString());
                }

                if (resp.ResponseType == ResponseType.Entity)
                {
                    Assert.IsFalse(string.IsNullOrEmpty((resp.Entity as OtherName).Id));
                }
                else if (resp.ResponseType == ResponseType.Query)
                {
                    Assert.IsTrue(resp.Entities != null && resp.Entities.Count > 0);
                }
                else if (resp.ResponseType == ResponseType.CdcQuery)
                {
                    Assert.IsTrue(resp.CDCResponse != null && resp.CDCResponse.entities != null && resp.CDCResponse.entities.Count > 0);
                }

                position++;
            }
        }
        public void CanMapOtherNameFromDomainToInfrastructure()
        {
            var firstName = _faker.Name.FirstName();
            var lastName  = _faker.Name.LastName();
            var createdBy = _faker.Internet.Email();

            var domainOtherName = new OtherName()
            {
                FirstName = firstName,
                LastName  = lastName
            };

            long personId = 123;

            var infrastructureOtherName = new PersonOtherName()
            {
                FirstName = firstName,
                LastName  = lastName,
                PersonId  = personId,
                CreatedBy = createdBy
            };

            domainOtherName.ToEntity(personId, createdBy).Should().BeEquivalentTo(infrastructureOtherName);
        }
Ejemplo n.º 17
0
        public void FillPersonalDetails()
        {
            SelectElement oSelect = new SelectElement(driver.FindElement(By.Id("TitleCombo")));

            oSelect.SelectByText(ExcelOperation.GetData[1]);
            GivenName.Clear();

            string GivenNameString = GenericHelper.RandomString(5);

            ExcelOperation.AddData("TestData2", GivenNameString, "TC1_CreateAnEmployee");
            GivenName.SendKeys(GivenNameString);
            OtherName.Clear();

            OtherName.SendKeys(ExcelOperation.GetData[3]);
            Surname.Clear();
            Surname.SendKeys(ExcelOperation.GetData[4]);
            PreferenceName.Clear();

            PreferenceName.SendKeys(ExcelOperation.GetData[5]);
            DateOfBirth.Clear();
            DateOfBirth.SendKeys(ExcelOperation.GetData[6]);
            Gender.Click();

            MobNumber.Clear();
            // MobNumber.SendKeys(ExcelOperation.GetData[7]);
            MobNumber.SendKeys("9999 999999");
            EmailID.Clear();
            EmailID.SendKeys(ExcelOperation.GetData[8]);

            PerferedMethodToContact.Click();
            GenericHelper.AllScreenShot(driver);
            var ele = driver.FindElement(By.Id("CommandButtons_cmdNextEnabled"));
            IJavaScriptExecutor executor = (IJavaScriptExecutor)driver;

            executor.ExecuteScript("var ele=arguments[0];setTimeout(function(){ele.click();},100)", ele);
        }
Ejemplo n.º 18
0
 public OtherNameForm(OtherName name)
 {
     InitializeComponent();
     this.OtherName = name;
 }
Ejemplo n.º 19
0
 public EditOtherName(OtherName name)
 {
     this.name = name;
 }
        public void CanMapPersonDetailsToGetPersonResponse()
        {
            Person person = DatabaseGatewayHelper.CreatePersonDatabaseEntity();

            person.Id = 123;

            Address address = DatabaseGatewayHelper.CreateAddressDatabaseEntity(person.Id);

            //set to display address
            address.IsDisplayAddress = "Y";

            PhoneNumber phoneNumber1 = DatabaseGatewayHelper.CreatePhoneNumberEntity(person.Id);
            PhoneNumber phoneNumber2 = DatabaseGatewayHelper.CreatePhoneNumberEntity(person.Id);

            PersonOtherName otherName1 = DatabaseGatewayHelper.CreatePersonOtherNameDatabaseEntity(person.Id);
            PersonOtherName otherName2 = DatabaseGatewayHelper.CreatePersonOtherNameDatabaseEntity(person.Id);

            person.Addresses = new List <Address>
            {
                address
            };

            person.PhoneNumbers = new List <PhoneNumber>
            {
                phoneNumber1,
                phoneNumber2
            };

            person.OtherNames = new List <PersonOtherName>
            {
                otherName1,
                otherName2
            };

            AddressDomain addressDomain = new AddressDomain()
            {
                Address  = address.AddressLines,
                Postcode = address.PostCode,
                Uprn     = address.Uprn
            };

            OtherName personOtherName1 = new OtherName()
            {
                FirstName = otherName1.FirstName,
                LastName  = otherName1.LastName
            };

            OtherName personOtherName2 = new OtherName()
            {
                FirstName = otherName2.FirstName,
                LastName  = otherName2.LastName
            };

            PhoneNumberDomain phoneNumberDomain1 = new PhoneNumberDomain()
            {
                Number = phoneNumber1.Number,
                Type   = phoneNumber1.Type
            };

            PhoneNumberDomain phoneNumberDomain2 = new PhoneNumberDomain()
            {
                Number = phoneNumber2.Number,
                Type   = phoneNumber2.Type
            };

            var expectedResponse = new GetPersonResponse()
            {
                EmailAddress      = person.EmailAddress,
                DateOfBirth       = person.DateOfBirth.Value,
                DateOfDeath       = person.DateOfDeath.Value,
                Address           = addressDomain,
                SexualOrientation = person.SexualOrientation,
                ContextFlag       = person.AgeContext,
                CreatedBy         = person.CreatedBy,
                Ethnicity         = person.Ethnicity,
                FirstLanguage     = person.FirstLanguage,
                FirstName         = person.FirstName,
                Gender            = person.Gender,
                LastName          = person.LastName,
                NhsNumber         = person.NhsNumber.Value,
                Id = person.Id,
                PreferredMethodOfContact = person.PreferredMethodOfContact,
                Religion   = person.Religion,
                Restricted = person.Restricted,
                Title      = person.Title,
                OtherNames = new List <OtherName>()
                {
                    personOtherName1, personOtherName2
                },
                PhoneNumbers = new List <PhoneNumberDomain>()
                {
                    phoneNumberDomain1, phoneNumberDomain2
                }
            };

            var result = ResponseFactory.ToResponse(person);

            result.Should().BeEquivalentTo(expectedResponse);
        }