Skip to content

Commit

Permalink
Merge pull request #52 from mwhelan/categorised-api
Browse files Browse the repository at this point in the history
Started alternate API for dictionaries
  • Loading branch information
robdmoore authored Aug 9, 2016
2 parents 8310b7f + 0e789f5 commit b0fda3d
Show file tree
Hide file tree
Showing 35 changed files with 595 additions and 396 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.AddressAusCity), GenerateTestCasesForSut(Any.AddressAusCity)},
{new Words(FromDictionary.AddressAusCity), GenerateTestCasesForSut(Any.AddressAus.City)},
new object[]
{new Words(FromDictionary.AddressAusCompany), GenerateTestCasesForSut(Any.AddressAusCompany)},
{new Words(FromDictionary.AddressAusCompany), GenerateTestCasesForSut(Any.AddressAus.Company)},
new object[]
{new Words(FromDictionary.AddressAusPhone), GenerateTestCasesForSut(Any.AddressAusPhone)},
{new Words(FromDictionary.AddressAusPhone), GenerateTestCasesForSut(Any.AddressAus.Phone)},
new object[]
{new Words(FromDictionary.AddressAusPostCode), GenerateTestCasesForSut(Any.AddressAusPostCode)},
{new Words(FromDictionary.AddressAusPostCode), GenerateTestCasesForSut(Any.AddressAus.PostCode)},
new object[]
{new Words(FromDictionary.AddressAusState), GenerateTestCasesForSut(Any.AddressAusState)},
{new Words(FromDictionary.AddressAusState), GenerateTestCasesForSut(Any.AddressAus.State)},
new object[]
{
new Words(FromDictionary.AddressAusStateAbbreviation),
GenerateTestCasesForSut(Any.AddressAusStateAbbreviation)
GenerateTestCasesForSut(Any.AddressAus.StateAbbreviation)
},
new object[]
{new Words(FromDictionary.AddressAusStreet), GenerateTestCasesForSut(Any.AddressAusStreet)},
{new Words(FromDictionary.AddressAusStreet), GenerateTestCasesForSut(Any.AddressAus.Street)},
new object[]
{new Words(FromDictionary.AddressAusWebsite), GenerateTestCasesForSut(Any.AddressAusWebsite)},
{new Words(FromDictionary.AddressAusWebsite), GenerateTestCasesForSut(Any.AddressAus.Website)},
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.AddressUkCounty), GenerateTestCasesForSut(Any.AddressUkCounty)},
{new Words(FromDictionary.AddressUkCounty), GenerateTestCasesForSut(Any.AddressUk.County)},
new object[]
{new Words(FromDictionary.AddressUkCity), GenerateTestCasesForSut(Any.AddressUkCity)},
{new Words(FromDictionary.AddressUkCity), GenerateTestCasesForSut(Any.AddressUk.City)},
new object[]
{new Words(FromDictionary.AddressUkCompany), GenerateTestCasesForSut(Any.AddressUkCompany)},
{new Words(FromDictionary.AddressUkCompany), GenerateTestCasesForSut(Any.AddressUk.Company)},
new object[]
{new Words(FromDictionary.AddressUkPhone), GenerateTestCasesForSut(Any.AddressUkPhone)},
{new Words(FromDictionary.AddressUkPhone), GenerateTestCasesForSut(Any.AddressUk.Phone)},
new object[]
{new Words(FromDictionary.AddressUkPostCode), GenerateTestCasesForSut(Any.AddressUkPostCode)},
{new Words(FromDictionary.AddressUkPostCode), GenerateTestCasesForSut(Any.AddressUk.PostCode)},
new object[]
{new Words(FromDictionary.AddressUkStreet), GenerateTestCasesForSut(Any.AddressUkStreet)},
{new Words(FromDictionary.AddressUkStreet), GenerateTestCasesForSut(Any.AddressUk.Street)},
new object[]
{new Words(FromDictionary.AddressUkWebsite), GenerateTestCasesForSut(Any.AddressUkWebsite)},
{new Words(FromDictionary.AddressUkWebsite), GenerateTestCasesForSut(Any.AddressUk.Website)},
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.AddressUsCity), GenerateTestCasesForSut(Any.AddressUsCity)},
{new Words(FromDictionary.AddressUsCity), GenerateTestCasesForSut(Any.AddressUs.City)},
new object[]
{new Words(FromDictionary.AddressUsCompany), GenerateTestCasesForSut(Any.AddressUsCompany)},
{new Words(FromDictionary.AddressUsCompany), GenerateTestCasesForSut(Any.AddressUs.Company)},
new object[]
{new Words(FromDictionary.AddressUsPhone), GenerateTestCasesForSut(Any.AddressUsPhone)},
{new Words(FromDictionary.AddressUsPhone), GenerateTestCasesForSut(Any.AddressUs.Phone)},
new object[]
{new Words(FromDictionary.AddressUsSocialSecurityNumber), GenerateTestCasesForSut(Any.AddressUsSocialSecurityNumber)},
{new Words(FromDictionary.AddressUsSocialSecurityNumber), GenerateTestCasesForSut(Any.AddressUs.SocialSecurityNumber)},
new object[]
{new Words(FromDictionary.AddressUsState), GenerateTestCasesForSut(Any.AddressUsState)},
{new Words(FromDictionary.AddressUsState), GenerateTestCasesForSut(Any.AddressUs.State)},
new object[]
{
new Words(FromDictionary.AddressUsStateAbbreviation),
GenerateTestCasesForSut(Any.AddressUsStateAbbreviation)
GenerateTestCasesForSut(Any.AddressUs.StateAbbreviation)
},
new object[]
{new Words(FromDictionary.AddressUsStreet), GenerateTestCasesForSut(Any.AddressUsStreet)},
{new Words(FromDictionary.AddressUsStreet), GenerateTestCasesForSut(Any.AddressUs.Street)},
new object[]
{new Words(FromDictionary.AddressUsWebsite), GenerateTestCasesForSut(Any.AddressUsWebsite)},
{new Words(FromDictionary.AddressUsWebsite), GenerateTestCasesForSut(Any.AddressUs.Website)},
new object[]
{new Words(FromDictionary.AddressUsZipCode), GenerateTestCasesForSut(Any.AddressUsZipCode)}
{new Words(FromDictionary.AddressUsZipCode), GenerateTestCasesForSut(Any.AddressUs.ZipCode)}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.ColourHex), GenerateTestCasesForSut(Any.ColourHex)},
{new Words(FromDictionary.ColourHex), GenerateTestCasesForSut(Any.Colour.Hex)},
new object[]
{new Words(FromDictionary.ColourName), GenerateTestCasesForSut(Any.ColourName)}
{new Words(FromDictionary.ColourName), GenerateTestCasesForSut(Any.Colour.Name)}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.CompanyName), GenerateTestCasesForSut(Any.CompanyName)},
{new Words(FromDictionary.CompanyName), GenerateTestCasesForSut(Any.Company.Name)},
new object[]
{new Words(FromDictionary.CompanyIndustry), GenerateTestCasesForSut(Any.CompanyIndustry)},
{new Words(FromDictionary.CompanyIndustry), GenerateTestCasesForSut(Any.Company.Industry)},
new object[]
{new Words(FromDictionary.CompanyJobTitle), GenerateTestCasesForSut(Any.CompanyJobTitle)},
{new Words(FromDictionary.CompanyJobTitle), GenerateTestCasesForSut(Any.Company.JobTitle)},
new object[]
{new Words(FromDictionary.CompanyLocation), GenerateTestCasesForSut(Any.CompanyLocation)}
{new Words(FromDictionary.CompanyLocation), GenerateTestCasesForSut(Any.Company.Location)}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.FinanceCreditCardNumber), GenerateTestCasesForSut(Any.FinanceCreditCardNumber)},
{new Words(FromDictionary.FinanceCreditCardNumber), GenerateTestCasesForSut(Any.Finance.CreditCardNumber)},
new object[]
{new Words(FromDictionary.FinanceCreditCardType), GenerateTestCasesForSut(Any.FinanceCreditCardType)},
{new Words(FromDictionary.FinanceCreditCardType), GenerateTestCasesForSut(Any.Finance.CreditCardType)},
new object[]
{new Words(FromDictionary.FinanceCurrency), GenerateTestCasesForSut(Any.FinanceCurrency)},
{new Words(FromDictionary.FinanceCurrency), GenerateTestCasesForSut(Any.Finance.Currency)},
new object[]
{new Words(FromDictionary.FinanceCurrencyCode), GenerateTestCasesForSut(Any.FinanceCurrencyCode)}
{new Words(FromDictionary.FinanceCurrencyCode), GenerateTestCasesForSut(Any.Finance.CurrencyCode)}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ protected override List<object[]> GetData()
{
return new List<object[]>
{
new object[] {new Words(FromDictionary.GeoContinent), GenerateTestCasesForSut(Any.GeoContinent)},
new object[] {new Words(FromDictionary.GeoCountry), GenerateTestCasesForSut(Any.GeoCountry)},
new object[] {new Words(FromDictionary.GeoCountryCode), GenerateTestCasesForSut(Any.GeoCountryCode)},
new object[] {new Words(FromDictionary.GeoLatitude), GenerateTestCasesForSut(Any.GeoLatitude)},
new object[] {new Words(FromDictionary.GeoLongitude), GenerateTestCasesForSut(Any.GeoLongitude)},
new object[] {new Words(FromDictionary.GeoContinent), GenerateTestCasesForSut(Any.Geography.Continent)},
new object[] {new Words(FromDictionary.GeoCountry), GenerateTestCasesForSut(Any.Geography.Country)},
new object[] {new Words(FromDictionary.GeoCountryCode), GenerateTestCasesForSut(Any.Geography.CountryCode)},
new object[] {new Words(FromDictionary.GeoLatitude), GenerateTestCasesForSut(Any.Geography.Latitude)},
new object[] {new Words(FromDictionary.GeoLongitude), GenerateTestCasesForSut(Any.Geography.Longitude)},
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ protected override List<object[]> GetData()
new object[]
{
new Words(FromDictionary.IdentifierBitcoinAddress),
GenerateTestCasesForSut(Any.IdentifierBitcoinAddress)
GenerateTestCasesForSut(Any.Identifier.BitcoinAddress)
},
new object[]
{new Words(FromDictionary.IdentifierIban), GenerateTestCasesForSut(Any.IdentifierIban)},
{new Words(FromDictionary.IdentifierIban), GenerateTestCasesForSut(Any.Identifier.Iban)},
new object[]
{
new Words(FromDictionary.IdentifierIpAddressV4), GenerateTestCasesForSut(Any.IdentifierIpAddressV4)
new Words(FromDictionary.IdentifierIpAddressV4), GenerateTestCasesForSut(Any.Identifier.IpAddressV4)
},
new object[]
{
new Words(FromDictionary.IdentifierIpAddressV6), GenerateTestCasesForSut(Any.IdentifierIpAddressV6)
new Words(FromDictionary.IdentifierIpAddressV6), GenerateTestCasesForSut(Any.Identifier.IpAddressV6)
},
new object[]
{new Words(FromDictionary.IdentifierIsbn), GenerateTestCasesForSut(Any.IdentifierIsbn)},
{new Words(FromDictionary.IdentifierIsbn), GenerateTestCasesForSut(Any.Identifier.Isbn)},
new object[]
{
new Words(FromDictionary.IdentifierMacAddress),
GenerateTestCasesForSut(Any.IdentifierMacAddress)
GenerateTestCasesForSut(Any.Identifier.MacAddress)
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ protected override List<object[]> GetData()
new object[]
{
new Words(FromDictionary.InternetDomainCountryCodeTopLevelDomain),
GenerateTestCasesForSut(Any.InternetDomainCountryCodeTopLevelDomain)
GenerateTestCasesForSut(Any.Internet.DomainCountryCodeTopLevelDomain)
},
new object[]
{new Words(FromDictionary.InternetDomainName), GenerateTestCasesForSut(Any.InternetDomainName)},
{new Words(FromDictionary.InternetDomainName), GenerateTestCasesForSut(Any.Internet.DomainName)},
new object[]
{
new Words(FromDictionary.InternetDomainTopLevel),
GenerateTestCasesForSut(Any.InternetDomainTopLevel)
GenerateTestCasesForSut(Any.Internet.DomainTopLevel)
},
new object[]
{new Words(FromDictionary.InternetUrl), GenerateTestCasesForSut(Any.InternetUrl)}
{new Words(FromDictionary.InternetUrl), GenerateTestCasesForSut(Any.Internet.Url)}
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void WhenGettingUniqueEmail_ThenReturnUniqueEmailsAcrossFixtureInstances(
var generatedValues = new List<string>();
var any2 = new AnonymousValueFixture();

any2.ResetUniqueEmailAddressSource();
PersonEquivalenceExtensions.InitializeUniqueEmailAddressSource();
generatedValues.Add(any2.UniqueEmailAddress());
for (var i = 0; i < source.Data.Count - 1; i++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public void WhenGettingUniqueEmail_ThenReturnUniqueEmailsAcrossFixtureInstances(
var generatedValues = new List<string>();
var any2 = new AnonymousValueFixture();

any2.ResetUniqueEmailAddressSource();
generatedValues.Add(any2.PersonUniqueEmailAddress());
PersonEquivalenceExtensions.InitializeUniqueEmailAddressSource();
generatedValues.Add(any2.Person.UniqueEmailAddress());
for (var i = 0; i < source.Data.Count - 1; i++)
{
generatedValues.Add(Any.PersonUniqueEmailAddress());
generatedValues.Add(Any.Person.UniqueEmailAddress());
}

generatedValues.Distinct().Count()
Expand All @@ -43,17 +43,17 @@ protected override List<object[]> GetData()
return new List<object[]>
{
new object[]
{new Words(FromDictionary.PersonEmailAddress), GenerateTestCasesForSut(Any.PersonEmailAddress)},
new object[] {new Words(FromDictionary.PersonLanguage), GenerateTestCasesForSut(Any.PersonLanguage)},
{new Words(FromDictionary.PersonEmailAddress), GenerateTestCasesForSut(Any.Person.EmailAddress)},
new object[] {new Words(FromDictionary.PersonLanguage), GenerateTestCasesForSut(Any.Person.Language)},
new object[]
{new Words(FromDictionary.PersonNameFirstFemale), GenerateTestCasesForSut(Any.PersonNameFirstFemale)},
new object[] {new Words(FromDictionary.PersonNameFirst), GenerateTestCasesForSut(Any.PersonNameFirst)},
new object[] {new Words(FromDictionary.PersonNameFull), GenerateTestCasesForSut(Any.PersonNameFull)},
new object[] {new Words(FromDictionary.PersonNameLast), GenerateTestCasesForSut(Any.PersonNameLast)},
{new Words(FromDictionary.PersonNameFirstFemale), GenerateTestCasesForSut(Any.Person.NameFirstFemale)},
new object[] {new Words(FromDictionary.PersonNameFirst), GenerateTestCasesForSut(Any.Person.NameFirst)},
new object[] {new Words(FromDictionary.PersonNameFull), GenerateTestCasesForSut(Any.Person.NameFull)},
new object[] {new Words(FromDictionary.PersonNameLast), GenerateTestCasesForSut(Any.Person.NameLast)},
new object[]
{new Words(FromDictionary.PersonNameFirstMale), GenerateTestCasesForSut(Any.PersonNameFirstMale)},
new object[] {new Words(FromDictionary.PersonNameSuffix), GenerateTestCasesForSut(Any.PersonNameSuffix)},
new object[] {new Words(FromDictionary.PersonNameTitle), GenerateTestCasesForSut(Any.PersonNameTitle)},
{new Words(FromDictionary.PersonNameFirstMale), GenerateTestCasesForSut(Any.Person.NameFirstMale)},
new object[] {new Words(FromDictionary.PersonNameSuffix), GenerateTestCasesForSut(Any.Person.NameSuffix)},
new object[] {new Words(FromDictionary.PersonNameTitle), GenerateTestCasesForSut(Any.Person.NameTitle)},
};
}
}
Expand Down
Loading

0 comments on commit b0fda3d

Please sign in to comment.