This commit is contained in:
simon987
2019-01-12 19:52:51 -05:00
parent 83276ce8b0
commit a2b5de0e01
10 changed files with 490 additions and 109 deletions

View File

@@ -12,9 +12,10 @@ import (
func TestCreateGetProject(t *testing.T) {
resp := createProject(api.CreateProjectRequest{
Name: "Test name",
GitUrl: "http://github.com/test/test",
Version: "Test Version",
Name: "Test name",
GitUrl: "http://github.com/test/test",
Version: "Test Version",
Priority: 123,
})
id := resp.Id
@@ -29,26 +30,27 @@ func TestCreateGetProject(t *testing.T) {
getResp, _ := getProject(id)
if getResp.Project.Id != id {
t.Fail()
t.Error()
}
if getResp.Project.Name != "Test name" {
t.Fail()
t.Error()
}
if getResp.Project.Version != "Test Version" {
t.Fail()
t.Error()
}
if getResp.Project.GitUrl != "http://github.com/test/test" {
t.Fail()
t.Error()
}
if getResp.Project.Priority != 123 {
t.Error()
}
}
func TestCreateProjectInvalid(t *testing.T) {
resp := createProject(api.CreateProjectRequest{
})
resp := createProject(api.CreateProjectRequest{})
if resp.Ok != false {
t.Fail()
@@ -111,4 +113,4 @@ func getProject(id int64) (*api.GetProjectResponse, *http.Response) {
handleErr(err)
return &getResp, r
}
}