func TestNoun(t *testing.T) { sing, plur := "ball", "balls" n := httpservice.NewNoun(sing, plur) if want, have := sing, n.Singular(); want != have { t.Errorf("expected: %#v, got: %#v", want, have) } if want, have := plur, n.Plural(); want != have { t.Errorf("expected: %#v, got: %#v", want, have) } }
func TestPaths(t *testing.T) { base, sing, plur := "/some/path", "ball", "balls" n := httpservice.NewNoun(sing, plur) p := httpservice.NewPaths(base, n, "someid") if want, have := "/some/path/ball/someid", p.Singular(); want != have { t.Errorf("expected: %#v, got: %#v", want, have) } if want, have := "/some/path/balls", p.Plural(); want != have { t.Errorf("expected: %#v, got: %#v", want, have) } }
func testDesc() httpservice.Desc { base, sing, plur := "/some/path", "ball", "balls" n := httpservice.NewNoun(sing, plur) p := httpservice.NewPaths(base, n, "someid") return httpservice.NewDesc(p) }