| 1 | package activitypub |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestContentOf(t *testing.T) { |
| 6 | tests := []struct { |
| 7 | name string |
| 8 | arg Item |
| 9 | want string |
| 10 | }{ |
| 11 | { |
| 12 | name: "empty", |
| 13 | arg: nil, |
| 14 | want: "", |
| 15 | }, |
| 16 | } |
| 17 | for _, tt := range tests { |
| 18 | t.Run(tt.name, func(t *testing.T) { |
| 19 | if got := ContentOf(tt.arg); got != tt.want { |
| 20 | t.Errorf("ContentOf() = %v, want %v", got, tt.want) |
| 21 | } |
| 22 | }) |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func TestNameOf(t *testing.T) { |
| 27 | tests := []struct { |
| 28 | name string |
| 29 | arg Item |
| 30 | want string |
| 31 | }{ |
| 32 | { |
| 33 | name: "empty", |
| 34 | arg: nil, |
| 35 | want: "", |
| 36 | }, |
| 37 | } |
| 38 | for _, tt := range tests { |
| 39 | t.Run(tt.name, func(t *testing.T) { |
| 40 | if got := NameOf(tt.arg); got != tt.want { |
| 41 | t.Errorf("NameOf() = %v, want %v", got, tt.want) |
| 42 | } |
| 43 | }) |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestPreferredNameOf(t *testing.T) { |
| 48 | tests := []struct { |
| 49 | name string |
| 50 | arg Item |
| 51 | want string |
| 52 | }{ |
| 53 | { |
| 54 | name: "empty", |
| 55 | arg: nil, |
| 56 | want: "", |
| 57 | }, |
| 58 | } |
| 59 | for _, tt := range tests { |
| 60 | t.Run(tt.name, func(t *testing.T) { |
| 61 | if got := PreferredNameOf(tt.arg); got != tt.want { |
| 62 | t.Errorf("PreferredNameOf() = %v, want %v", got, tt.want) |
| 63 | } |
| 64 | }) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | func TestSummaryOf(t *testing.T) { |
| 69 | tests := []struct { |
| 70 | name string |
| 71 | arg Item |
| 72 | want string |
| 73 | }{ |
| 74 | { |
| 75 | name: "empty", |
| 76 | arg: nil, |
| 77 | want: "", |
| 78 | }, |
| 79 | } |
| 80 | for _, tt := range tests { |
| 81 | t.Run(tt.name, func(t *testing.T) { |
| 82 | if got := SummaryOf(tt.arg); got != tt.want { |
| 83 | t.Errorf("SummaryOf() = %v, want %v", got, tt.want) |
| 84 | } |
| 85 | }) |
| 86 | } |
| 87 | } |