Skip to content

Commit

Permalink
xamarin app type test
Browse files Browse the repository at this point in the history
  • Loading branch information
odra committed Apr 6, 2018
1 parent ca9e127 commit 74ce03b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pkg/cmd/clients_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,43 @@ func TestMobileClientsCmd_TestCreateClient(t *testing.T) {
}
},
},
{
Name: "test create xamarin mobile client succeeds without error",
Args: []string{"test", "xamarin", "my.app.org"},
MobileClient: func() mc.Interface {
fkMc := &mcFake.Clientset{}
fkMc.AddReactor("create", "mobileclients", func(action kt.Action) (handled bool, ret runtime.Object, err error) {
ca := action.(kt.CreateAction)
return true, ca.GetObject(), nil
})
return fkMc
},
Flags: []string{"--namespace=myproject", "-o=json"},
Validate: func(t *testing.T, c *v1alpha1.MobileClient) {
if nil == c {
t.Fatal("expected a mobile client but got nil")
}
if c.Spec.ClientType != "xamarin" {
t.Fatal("expected the clientType to be cordova but got ", c.Spec.ClientType)
}
if c.Spec.AppIdentifier != "my.app.org" {
t.Fatal("expected an appIdentifier to be set as my.app.org but was ", c.Spec.AppIdentifier)
}
if c.Spec.Name != "test" {
t.Fatal("expected the client name to be test but got ", c.Spec.Name)
}
if c.Spec.ApiKey == "" {
t.Fatal("expected an apiKey to be generated but it was empty")
}
icon, ok := c.Annotations["icon"]
if !ok {
t.Fatal("expected an icon to be set but there was none")
}
if icon != "fa fa-xamarin" {
t.Fatal("expected the icon to be fa-xamarin but got ", icon)
}
},
},
{
Name: "test create mobile client fails with unknown client type",
Args: []string{"test", "firefox", "my.app.org"},
Expand Down

0 comments on commit 74ce03b

Please sign in to comment.