aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab/import_test.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-02-14 11:36:32 +0100
committerMichael Muré <batolettre@gmail.com>2021-02-14 12:19:50 +0100
commit3f6ef50883492f77995a7e27872d0b5ae17b9d6a (patch)
tree97677642f1b01c73c8c5a708ea0ec67ced8c402f /bridge/gitlab/import_test.go
parent99b9dd84cb4b0cfd3eb1fd50b07c8b826eb52d19 (diff)
downloadgit-bug-3f6ef50883492f77995a7e27872d0b5ae17b9d6a.tar.gz
bug: migrate to the DAG entity structure!
Diffstat (limited to 'bridge/gitlab/import_test.go')
-rw-r--r--bridge/gitlab/import_test.go27
1 files changed, 11 insertions, 16 deletions
diff --git a/bridge/gitlab/import_test.go b/bridge/gitlab/import_test.go
index 2956ad8b..1405e43b 100644
--- a/bridge/gitlab/import_test.go
+++ b/bridge/gitlab/import_test.go
@@ -138,29 +138,24 @@ func TestGitlabImport(t *testing.T) {
for i, op := range tt.bug.Operations {
require.IsType(t, ops[i], op)
+ require.Equal(t, op.Author().Name(), ops[i].Author().Name())
- switch op.(type) {
+ switch op := op.(type) {
case *bug.CreateOperation:
- require.Equal(t, op.(*bug.CreateOperation).Title, ops[i].(*bug.CreateOperation).Title)
- require.Equal(t, op.(*bug.CreateOperation).Message, ops[i].(*bug.CreateOperation).Message)
- require.Equal(t, op.(*bug.CreateOperation).Author.Name(), ops[i].(*bug.CreateOperation).Author.Name())
+ require.Equal(t, op.Title, ops[i].(*bug.CreateOperation).Title)
+ require.Equal(t, op.Message, ops[i].(*bug.CreateOperation).Message)
case *bug.SetStatusOperation:
- require.Equal(t, op.(*bug.SetStatusOperation).Status, ops[i].(*bug.SetStatusOperation).Status)
- require.Equal(t, op.(*bug.SetStatusOperation).Author.Name(), ops[i].(*bug.SetStatusOperation).Author.Name())
+ require.Equal(t, op.Status, ops[i].(*bug.SetStatusOperation).Status)
case *bug.SetTitleOperation:
- require.Equal(t, op.(*bug.SetTitleOperation).Was, ops[i].(*bug.SetTitleOperation).Was)
- require.Equal(t, op.(*bug.SetTitleOperation).Title, ops[i].(*bug.SetTitleOperation).Title)
- require.Equal(t, op.(*bug.SetTitleOperation).Author.Name(), ops[i].(*bug.SetTitleOperation).Author.Name())
+ require.Equal(t, op.Was, ops[i].(*bug.SetTitleOperation).Was)
+ require.Equal(t, op.Title, ops[i].(*bug.SetTitleOperation).Title)
case *bug.LabelChangeOperation:
- require.ElementsMatch(t, op.(*bug.LabelChangeOperation).Added, ops[i].(*bug.LabelChangeOperation).Added)
- require.ElementsMatch(t, op.(*bug.LabelChangeOperation).Removed, ops[i].(*bug.LabelChangeOperation).Removed)
- require.Equal(t, op.(*bug.LabelChangeOperation).Author.Name(), ops[i].(*bug.LabelChangeOperation).Author.Name())
+ require.ElementsMatch(t, op.Added, ops[i].(*bug.LabelChangeOperation).Added)
+ require.ElementsMatch(t, op.Removed, ops[i].(*bug.LabelChangeOperation).Removed)
case *bug.AddCommentOperation:
- require.Equal(t, op.(*bug.AddCommentOperation).Message, ops[i].(*bug.AddCommentOperation).Message)
- require.Equal(t, op.(*bug.AddCommentOperation).Author.Name(), ops[i].(*bug.AddCommentOperation).Author.Name())
+ require.Equal(t, op.Message, ops[i].(*bug.AddCommentOperation).Message)
case *bug.EditCommentOperation:
- require.Equal(t, op.(*bug.EditCommentOperation).Message, ops[i].(*bug.EditCommentOperation).Message)
- require.Equal(t, op.(*bug.EditCommentOperation).Author.Name(), ops[i].(*bug.EditCommentOperation).Author.Name())
+ require.Equal(t, op.Message, ops[i].(*bug.EditCommentOperation).Message)
default:
panic("unknown operation type")