add unit test for ParseChannel
@@ -158,3 +158,15 @@ func TestEventReceiver_ServeHTTP(t *testing.T) {
})
}
}
+func TestEventReceiver_ParseChannel(t *testing.T) {
+ c, err := ParseChannel("test-channel.test-namespace.svc.")
+ if err != nil {
+ t.Errorf("Unexpected error: %v", err)
+ }
+ if c.Name != "test-channel" {
+ t.Errorf("Expected Name: test-channel. Got: %q", c.Name)
+ }
+ if c.Namespace != "test-namespace" {
+ t.Errorf("Expected Name: test-namespace. Got: %q", c.Namespace)
+ }
+}
