MCPcopy Create free account
hub / github.com/DiUS/java-faker / CompanyTest

Class CompanyTest

src/test/java/com/github/javafaker/CompanyTest.java:8–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6import static org.junit.Assert.assertThat;
7
8public class CompanyTest extends AbstractFakerTest {
9
10 @Test
11 public void testName() {
12 assertThat(faker.company().name(), matchesRegularExpression("[A-Za-z\\-&', ]+"));
13 }
14
15 @Test
16 public void testSuffix() {
17 assertThat(faker.company().suffix(), matchesRegularExpression("[A-Za-z ]+"));
18 }
19
20 @Test
21 public void testIndustry() {
22 assertThat(faker.company().industry(), matchesRegularExpression("(\\w+([ ,&/-]{1,3})?){1,4}+"));
23 }
24
25 @Test
26 public void testBuzzword() {
27 assertThat(faker.company().buzzword(), matchesRegularExpression("(\\w+[ /-]?){1,3}"));
28 }
29
30 @Test
31 public void testCatchPhrase() {
32 assertThat(faker.company().catchPhrase(), matchesRegularExpression("(\\w+[ /-]?){1,9}"));
33 }
34
35 @Test
36 public void testBs() {
37 assertThat(faker.company().bs(), matchesRegularExpression("(\\w+[ /-]?){1,9}"));
38 }
39
40 @Test
41 public void testLogo() {
42 assertThat(faker.company().logo(), matchesRegularExpression("https://pigment.github.io/fake-logos/logos/medium/color/\\d+\\.png"));
43 }
44
45 @Test
46 public void testProfession() {
47 assertThat(faker.company().profession(), matchesRegularExpression("[a-z ]+"));
48 }
49
50 @Test
51 public void testUrl() {
52 String regexp = "(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])";
53 assertThat(faker.company().url(), matchesRegularExpression(regexp));
54 }
55}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected