Repository: bxcodec/faker
Pull request #13 (2017-10-30 18:51:38)

constructor provider make public
I make function-constructor public access

codecov[bot]: # [Codecov](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=h1) Report
> Merging [#13](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=desc) into [master](https://codecov.io/gh/bxcodec/faker/commit/1936f930b1adc6c20e34314f93d84ea75caf60e5?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/bxcodec/faker/pull/13/graphs/tree.svg?token=cLPGB7MHVc&src=pr&width=650&height=150)](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree)

```diff
@@          Coverage Diff          @@
##           master    #13   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      8           
  Lines         380    380           
=====================================
  Hits          380    380
```


| [Impacted Files](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [faker.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-ZmFrZXIuZ28=) | `100% <ø> (ø)` | :arrow_up: |
| [lorem.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-bG9yZW0uZ28=) | `100% <100%> (ø)` | :arrow_up: |
| [phone.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-cGhvbmUuZ28=) | `100% <100%> (ø)` | :arrow_up: |
| [person.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-cGVyc29uLmdv) | `100% <100%> (ø)` | :arrow_up: |
| [address.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-YWRkcmVzcy5nbw==) | `100% <100%> (ø)` | :arrow_up: |
| [internet.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-aW50ZXJuZXQuZ28=) | `100% <100%> (ø)` | :arrow_up: |
| [datetime.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-ZGF0ZXRpbWUuZ28=) | `100% <100%> (ø)` | :arrow_up: |
| [payment.go](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=tree#diff-cGF5bWVudC5nbw==) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=footer). Last update [1936f93...4841eaf](https://codecov.io/gh/bxcodec/faker/pull/13?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/address.go b/address.go
index 46bf5e6..c5ee921 100644
--- a/address.go
+++ b/address.go
@@ -8,7 +8,7 @@ import (
 var address Addresser
 
 // Constructor
-func getAddress() Addresser {
+func GetAddress() Addresser {
 	mu.Lock()
 	defer mu.Unlock()
 
diff --git a/datetime.go b/datetime.go
index 60b7a10..2beab87 100644
--- a/datetime.go
+++ b/datetime.go
@@ -619,7 +619,7 @@ type DateTimer interface {
 
 var date DateTimer
 
-func getDateTimer() DateTimer {
+func GetDateTimer() DateTimer {
 	mu.Lock()
 	defer mu.Unlock()
 
diff --git a/faker.go b/faker.go
index 52005d0..4ef4477 100644
--- a/faker.go
+++ b/faker.go
@@ -58,41 +58,41 @@ const (
 )
 
 var mapperTag = map[string]interface{}{
-	Email:              getNetworker().Email,
-	MacAddress:         getNetworker().MacAddress,
-	DomainName:         getNetworker().DomainName,
-	Url:                getNetworker().Url,
-	UserName:           getNetworker().UserName,
-	IPV4:               getNetworker().Ipv4,
-	IPV6:               getNetworker().Ipv6,
-	PASSWORD:           getNetworker().Password,
-	CREDIT_CARD_TYPE:   getPayment().CreditCardType,
-	CREDIT_CARD_NUMBER: getPayment().CreditCardNumber,
-	LATITUDE:           getAddress().Latitude,
-	LONGITUDE:          getAddress().Longitude,
-	PHONE_NUMBER:       getPhoner().PhoneNumber,
-	TOLL_FREE_NUMBER:   getPhoner().TollFreePhoneNumber,
-	E164_PHONE_NUMBER:  getPhoner().E164PhoneNumber,
-	TITLE_MALE:         getPerson().TitleMale,
-	TITLE_FEMALE:       getPerson().TitleFeMale,
-	FIRST_NAME_MALE:    getPerson().FirstNameMale,
-	FIRST_NAME_FEMALE:  getPerson().FirstNameFemale,
-	LAST_NAME:          getPerson().LastName,
-	NAME:               getPerson().Name,
-	UNIX_TIME:          getDateTimer().UnixTime,
-	DATE:               getDateTimer().Date,
-	TIME:               getDateTimer().Time,
-	MONTH_NAME:         getDateTimer().MonthName,
-	YEAR:               getDateTimer().Year,
-	DAY_OF_WEEK:        getDateTimer().DayOfWeek,
-	DAY_OF_MONTH:       getDateTimer().DayOfMonth,
-	TIMESTAMP:          getDateTimer().Timestamp,
-	CENTURY:            getDateTimer().Century,
-	TIMEZONE:           getDateTimer().TimeZone,
-	TIME_PERIOD:        getDateTimer().TimePeriod,
-	WORD:               getLorem().Word,
-	SENTENCE:           getLorem().Sentence,
-	SENTENCES:          getLorem().Sentences,
+	Email:              GetNetworker().Email,
+	MacAddress:         GetNetworker().MacAddress,
+	DomainName:         GetNetworker().DomainName,
+	Url:                GetNetworker().Url,
+	UserName:           GetNetworker().UserName,
+	IPV4:               GetNetworker().Ipv4,
+	IPV6:               GetNetworker().Ipv6,
+	PASSWORD:           GetNetworker().Password,
+	CREDIT_CARD_TYPE:   GetPayment().CreditCardType,
+	CREDIT_CARD_NUMBER: GetPayment().CreditCardNumber,
+	LATITUDE:           GetAddress().Latitude,
+	LONGITUDE:          GetAddress().Longitude,
+	PHONE_NUMBER:       GetPhoner().PhoneNumber,
+	TOLL_FREE_NUMBER:   GetPhoner().TollFreePhoneNumber,
+	E164_PHONE_NUMBER:  GetPhoner().E164PhoneNumber,
+	TITLE_MALE:         GetPerson().TitleMale,
+	TITLE_FEMALE:       GetPerson().TitleFeMale,
+	FIRST_NAME_MALE:    GetPerson().FirstNameMale,
+	FIRST_NAME_FEMALE:  GetPerson().FirstNameFemale,
+	LAST_NAME:          GetPerson().LastName,
+	NAME:               GetPerson().Name,
+	UNIX_TIME:          GetDateTimer().UnixTime,
+	DATE:               GetDateTimer().Date,
+	TIME:               GetDateTimer().Time,
+	MONTH_NAME:         GetDateTimer().MonthName,
+	YEAR:               GetDateTimer().Year,
+	DAY_OF_WEEK:        GetDateTimer().DayOfWeek,
+	DAY_OF_MONTH:       GetDateTimer().DayOfMonth,
+	TIMESTAMP:          GetDateTimer().Timestamp,
+	CENTURY:            GetDateTimer().Century,
+	TIMEZONE:           GetDateTimer().TimeZone,
+	TIME_PERIOD:        GetDateTimer().TimePeriod,
+	WORD:               GetLorem().Word,
+	SENTENCE:           GetLorem().Sentence,
+	SENTENCES:          GetLorem().Sentences,
 }
 
 // Error when get fake from ptr
@@ -325,6 +325,7 @@ func randomStringNumber(n int) string {
 / Get three parameters , only first mandatory and the rest are optional
 / --- If only set one parameter :  This means the minimum number of digits and the total number
 / --- If only set two parameters : First this is min digit and second max digit and the total number the difference between them
+/ --- If only three parameters: the third argument set Max count Digit
 */
 func RandomInt(parameters ...int) (p []int, err error) {
 	r := rand.New(rand.NewSource(time.Now().UnixNano()))
diff --git a/internet.go b/internet.go
index 1cdb707..f3d6991 100644
--- a/internet.go
+++ b/internet.go
@@ -23,7 +23,7 @@ var urlFormats = []string{
 var internet Networker
 
 // Constructor
-func getNetworker() Networker {
+func GetNetworker() Networker {
 	mu.Lock()
 	defer mu.Unlock()
 
diff --git a/lorem.go b/lorem.go
index 4b578c8..cf31159 100644
--- a/lorem.go
+++ b/lorem.go
@@ -55,7 +55,7 @@ func SetDataFaker(d DataFaker) {
 }
 
 // Constructor
-func getLorem() DataFaker {
+func GetLorem() DataFaker {
 	mu.Lock()
 	defer mu.Unlock()
 
diff --git a/payment.go b/payment.go
index 0a7d648..1298d21 100644
--- a/payment.go
+++ b/payment.go
@@ -30,7 +30,7 @@ var pay Render
 var cacheCreditCard string
 
 // Constructor
-func getPayment() Render {
+func GetPayment() Render {
 	mu.Lock()
 	defer mu.Unlock()
 
diff --git a/person.go b/person.go
index ccd4730..81bfe73 100644
--- a/person.go
+++ b/person.go
@@ -100,7 +100,7 @@ var lastNames = []string{
 }
 var randNameFlag = rand.Intn(100)
 
-func getPerson() Dowser {
+func GetPerson() Dowser {
 	mu.Lock()
 	defer mu.Unlock()
 
diff --git a/phone.go b/phone.go
index 8c7fb5c..158ebf1 100644
--- a/phone.go
+++ b/phone.go
@@ -11,7 +11,7 @@ import (
 var phone Phoner
 
 // Constructor
-func getPhoner() Phoner {
+func GetPhoner() Phoner {
 	mu.Lock()
 	defer mu.Unlock()
 


Test patch:
diff --git a/datetime_test.go b/datetime_test.go
index e818806..76d7e99 100644
--- a/datetime_test.go
+++ b/datetime_test.go
@@ -14,7 +14,7 @@ func TestSetDateTimer(t *testing.T) {
 }
 
 func TestUnixTimeValueValid(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	var ref = struct {
 		some int64
 	}{
@@ -27,7 +27,7 @@ func TestUnixTimeValueValid(t *testing.T) {
 	}
 }
 func TestUnixTimeValueNotValid(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	var ref = struct {
 		some int
 	}{
@@ -41,7 +41,7 @@ func TestUnixTimeValueNotValid(t *testing.T) {
 }
 
 func TestDate(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(BaseDate, d.Date())
 
 	if err != nil {
@@ -50,7 +50,7 @@ func TestDate(t *testing.T) {
 }
 
 func TestTime(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(Time, d.Time())
 
 	if err != nil {
@@ -59,7 +59,7 @@ func TestTime(t *testing.T) {
 }
 
 func TestMonthName(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(Month, d.MonthName())
 	if err != nil {
 		t.Error("function Month need return valid month")
@@ -67,7 +67,7 @@ func TestMonthName(t *testing.T) {
 }
 
 func TestYear(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(Year, d.Year())
 	if err != nil {
 		t.Error("function Year need return valid year")
@@ -75,7 +75,7 @@ func TestYear(t *testing.T) {
 }
 
 func TestDayOfWeek(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(Day, d.DayOfWeek())
 	if err != nil {
 		t.Error("function DayOfWeek need return valid day")
@@ -83,7 +83,7 @@ func TestDayOfWeek(t *testing.T) {
 }
 
 func TestDayOfMonth(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(DayOfMonth, d.DayOfMonth())
 	if err != nil {
 		t.Error("function DayOfMonth need return valid digit")
@@ -91,7 +91,7 @@ func TestDayOfMonth(t *testing.T) {
 }
 
 func TestTimestamp(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(fmt.Sprintf("%s %s", BaseDate, Time), d.Timestamp())
 	if err != nil {
 		t.Error("function Timestamp need return valid timestamp format")
@@ -99,7 +99,7 @@ func TestTimestamp(t *testing.T) {
 }
 
 func TestCentury(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 
 	if !slice.Contains(century, d.Century()) {
 		t.Error("Expected century from functuon Century")
@@ -107,14 +107,14 @@ func TestCentury(t *testing.T) {
 }
 
 func TestTimeZone(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	if !slice.Contains(timezones, d.TimeZone()) {
 		t.Error("Expected timezone from variable timezones")
 	}
 }
 
 func TestTimePeriod(t *testing.T) {
-	d := getDateTimer()
+	d := GetDateTimer()
 	_, err := time.Parse(TimePeriod, d.TimePeriod())
 	if err != nil {
 		t.Error("function TimePeriod need return valid period")
diff --git a/internet_test.go b/internet_test.go
index 1bed114..cb814a9 100644
--- a/internet_test.go
+++ b/internet_test.go
@@ -7,7 +7,7 @@ import (
 )
 
 func TestEmail(t *testing.T) {
-	if !strings.Contains(getNetworker().Email(), "@") {
+	if !strings.Contains(GetNetworker().Email(), "@") {
 		t.Error("Expected  email")
 	}
 }
@@ -19,7 +19,7 @@ func TestMacAddress(t *testing.T) {
 	}
 }
 func TestDomainName(t *testing.T) {
-	preTld := strings.Split(getNetworker().DomainName(), ".")
+	preTld := strings.Split(GetNetworker().DomainName(), ".")
 
 	if !slice.Contains(tld, preTld[1]) {
 		t.Error("Expected get DomainName")
@@ -29,7 +29,7 @@ func TestUrlOneVerbs(t *testing.T) {
 	urlFormats = []string{
 		"http://www.%s/"}
 
-	if !strings.Contains(getNetworker().Url(), "http") {
+	if !strings.Contains(GetNetworker().Url(), "http") {
 		t.Error("Expected get url")
 	}
 }
@@ -37,23 +37,23 @@ func TestUrlTwoVerbs(t *testing.T) {
 	urlFormats = []string{
 		"http://www.%s/%s"}
 
-	if !strings.Contains(getNetworker().Url(), "http") {
+	if !strings.Contains(GetNetworker().Url(), "http") {
 		t.Error("Expected get url")
 	}
 }
 func TestUserName(t *testing.T) {
-	if getNetworker().UserName() == "" {
+	if GetNetworker().UserName() == "" {
 		t.Error("Expected get username")
 	}
 
 }
 func TestIpv4(t *testing.T) {
-	if strings.Count(getNetworker().Ipv4(), ".") != 3 {
+	if strings.Count(GetNetworker().Ipv4(), ".") != 3 {
 		t.Error("Expected Ipv4 format")
 	}
 }
 func TestIpv6(t *testing.T) {
-	if strings.Count(getNetworker().Ipv6(), ":") != 7 {
+	if strings.Count(GetNetworker().Ipv6(), ":") != 7 {
 		t.Error("Expected Ipv4 format")
 	}
 }
@@ -62,7 +62,7 @@ func TestSetNetwork(t *testing.T) {
 }
 
 func TestPassword(t *testing.T) {
-	if getNetworker().Password() == "" {
+	if GetNetworker().Password() == "" {
 		t.Error("Expected hash password")
 	}
 }
diff --git a/lorem_test.go b/lorem_test.go
index 4d2bc53..31d54ff 100644
--- a/lorem_test.go
+++ b/lorem_test.go
@@ -11,20 +11,20 @@ func TestDataFaker(t *testing.T) {
 }
 
 func TestWord(t *testing.T) {
-	if !slice.Contains(wordList, getLorem().Word()) {
+	if !slice.Contains(wordList, GetLorem().Word()) {
 		t.Error("Expected word from slice wordList")
 	}
 }
 
 func TestSentence(t *testing.T) {
-	s := getLorem().Sentence()
+	s := GetLorem().Sentence()
 	if s == "" || !strings.HasSuffix(s, ".") {
 		t.Error("Expected sentence")
 	}
 }
 
 func TestSentences(t *testing.T) {
-	s := getLorem().Sentences()
+	s := GetLorem().Sentences()
 	if s == "" || !strings.HasSuffix(s, ".") {
 		t.Error("Expected sentences")
 	}
diff --git a/payment_test.go b/payment_test.go
index 7c1f6d3..f560fee 100644
--- a/payment_test.go
+++ b/payment_test.go
@@ -6,14 +6,14 @@ import (
 )
 
 func TestCreditCardType(t *testing.T) {
-	randCC := strings.ToLower(getPayment().CreditCardType())
+	randCC := strings.ToLower(GetPayment().CreditCardType())
 	if _, exist := creditCards[randCC]; !exist {
 		t.Errorf("Expected from function creditCardType() : %s", randCC)
 	}
 }
 
 func TestCreditCardNumber(t *testing.T) {
-	getPayment().CreditCardNumber()
+	GetPayment().CreditCardNumber()
 }
 
 func TestSetPayment(t *testing.T)  {
diff --git a/person_test.go b/person_test.go
index 69be307..2fc9c87 100644
--- a/person_test.go
+++ b/person_test.go
@@ -10,49 +10,49 @@ func TestSetDowser(t *testing.T) {
 }
 
 func TestTitleMale(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	if !slice.Contains(titlesMale, p.TitleMale()) {
 		t.Error("Expected value from variable titleMales in function TitleMale")
 	}
 }
 
 func TestTitleFemale(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	if !slice.Contains(titlesFemale, p.TitleFeMale()) {
 		t.Error("Expected value from variable titleFemales in function TitleFeMale")
 	}
 }
 
 func TestFirstNameMale(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	if !slice.Contains(firstNamesMale, p.FirstNameMale()) {
 		t.Error("Expected value from variable firstNamesMale in function FirstNameMale")
 	}
 }
 
 func TestFirstNameFemale(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	if !slice.Contains(firstNamesFemale, p.FirstNameFemale()) {
 		t.Error("Expected value from variable firstNamesFemale in function FirstNameFemale")
 	}
 }
 
 func TestLastName(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	if !slice.Contains(lastNames, p.LastName()) {
 		t.Error("Expected value from variable lastNames in function LastName")
 	}
 }
 
 func TestNameMale(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	randNameFlag = 51
 	if p.Name() == "" {
 		t.Error("Expected from function name string get empty string")
 	}
 }
 func TestNameFemale(t *testing.T) {
-	p := getPerson()
+	p := GetPerson()
 	randNameFlag = 20
 	if p.Name() == "" {
 		t.Error("Expected from function name string get empty string")
diff --git a/phone_test.go b/phone_test.go
index f650630..8bc9a0a 100644
--- a/phone_test.go
+++ b/phone_test.go
@@ -6,14 +6,14 @@ import (
 )
 
 func TestPhoneNumber(t *testing.T) {
-	ph := getPhoner()
+	ph := GetPhoner()
 	if strings.Count(ph.PhoneNumber(), "-") != 2 {
 		t.Error("Expected no more than two characters '-'")
 	}
 }
 
 func TestTollFreePhoneNumber(t *testing.T) {
-	ph := getPhoner()
+	ph := GetPhoner()
 
 	if !strings.HasPrefix(ph.TollFreePhoneNumber(), "(888)") && !strings.HasPrefix(ph.TollFreePhoneNumber(), "(777)") {
 		t.Error("Expected character '(888)' or (777), in function TollFreePhoneNumber")
@@ -21,7 +21,7 @@ func TestTollFreePhoneNumber(t *testing.T) {
 }
 
 func TestE164PhoneNumber(t *testing.T) {
-	ph := getPhoner()
+	ph := GetPhoner()
 	if !strings.HasPrefix(ph.E164PhoneNumber(), "+") {
 		t.Error("Expected character '(888)', in function TollFreePhoneNumber")
 	}