Example #1
0
func TestProducts(t *testing.T) {
	for _, lang := range faker.GetLangs() {
		faker.SetLang(lang)

		v := faker.Brand()
		if v == "" {
			t.Errorf("Brand failed with lang %s", lang)
		}

		v = faker.ProductName()
		if v == "" {
			t.Errorf("ProductName failed with lang %s", lang)
		}

		v = faker.Product()
		if v == "" {
			t.Errorf("Product failed with lang %s", lang)
		}

		v = faker.Model()
		if v == "" {
			t.Errorf("Model failed with lang %s", lang)
		}
	}
}
Example #2
0
func TestFakerRuWithCallback(t *testing.T) {
	faker.SetLang("ru")
	faker.EnFallback(true)
	brand := faker.Brand()
	if brand == "" {
		t.Error("Fake call for name with no samples with callback should not return blank string")
	}
}
Example #3
0
func TestFakerRuWithoutCallback(t *testing.T) {
	faker.SetLang("ru")
	faker.EnFallback(false)
	brand := faker.Brand()
	if brand != "" {
		t.Error("Fake call with no samples should return blank string")
	}
}