Regression test from before ExportData was implemented.
(t *testing.T)
| 9 | |
| 10 | // Regression test from before ExportData was implemented. |
| 11 | func TestJSONProject_User(t *testing.T) { |
| 12 | project := Project{ |
| 13 | ID: "123", |
| 14 | Number: 2, |
| 15 | URL: "a url", |
| 16 | ShortDescription: "short description", |
| 17 | Public: true, |
| 18 | Readme: "readme", |
| 19 | } |
| 20 | |
| 21 | project.Items.TotalCount = 1 |
| 22 | project.Fields.TotalCount = 2 |
| 23 | project.Owner.TypeName = "User" |
| 24 | project.Owner.User.Login = "monalisa" |
| 25 | b, err := json.Marshal(project.ExportData(nil)) |
| 26 | assert.NoError(t, err) |
| 27 | |
| 28 | assert.JSONEq(t, `{"number":2,"url":"a url","shortDescription":"short description","public":true,"closed":false,"title":"","id":"123","readme":"readme","items":{"totalCount":1},"fields":{"totalCount":2},"owner":{"type":"User","login":"monalisa"}}`, string(b)) |
| 29 | } |
| 30 | |
| 31 | // Regression test from before ExportData was implemented. |
| 32 | func TestJSONProject_Org(t *testing.T) { |
nothing calls this directly
no test coverage detected