Exemplo n.º 1
0
        public void GetHashcodeTest()
        {
            List <NationalId> nationalIds = new List <NationalId>();
            Dictionary <string, Dictionary <string, string> > countrySpecific = new Dictionary <string, Dictionary <string, string> >
            {
                { "test-outerKey1", new Dictionary <string, string> {
                      { "test-key1", "test-value1" }, { "test-key2", "test-value2" }
                  } },
                { "test-outerKey2", new Dictionary <string, string> {
                      { "test-key1", "test-value1" }, { "test-key2", "test-value2" }
                  } },
                { "test-outerKey3", new Dictionary <string, string> {
                      { "test-key1", "test-value1" }, { "test-key2", "test-value2" }
                  } }
            };
            DataFields dataFields1 = new DataFields();

            dataFields1.PersonInfo      = new PersonInfo(firstGivenName: "test-firstGivenName");
            dataFields1.Location        = new Location(city: "test-city");
            dataFields1.Communication   = new Communication(emailAddress: "test-emailAddress");
            dataFields1.DriverLicence   = new DriverLicence(number: "test-number");
            dataFields1.NationalIds     = nationalIds;
            dataFields1.Passport        = new Passport(mrz1: "test-mrz1");
            dataFields1.Document        = new Document(documentType: "test-documentType");
            dataFields1.Business        = new Business(businessName: "test-businessName");
            dataFields1.CountrySpecific = countrySpecific;

            DataFields dataFields2 = new DataFields();

            dataFields2.PersonInfo      = new PersonInfo(firstGivenName: "test-firstGivenName");
            dataFields2.Location        = new Location(city: "test-city");
            dataFields2.Communication   = new Communication(emailAddress: "test-emailAddress");
            dataFields2.DriverLicence   = new DriverLicence(number: "test-number");
            dataFields2.NationalIds     = nationalIds;
            dataFields2.Passport        = new Passport(mrz1: "test-mrz1");
            dataFields2.Document        = new Document(documentType: "test-documentType");
            dataFields2.Business        = new Business(businessName: "test-businessName");
            dataFields2.CountrySpecific = countrySpecific;

            Assert.Equal(dataFields1.GetHashCode(), dataFields2.GetHashCode());
        }