(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func TestFieldsListGetByName(t *testing.T) { |
| 124 | f1 := &core.TextField{Id: "id1", Name: "test1"} |
| 125 | f2 := &core.EmailField{Id: "id2", Name: "test2"} |
| 126 | testFieldsList := core.NewFieldsList(f1, f2) |
| 127 | |
| 128 | // missing field name |
| 129 | result1 := testFieldsList.GetByName("id1") |
| 130 | if result1 != nil { |
| 131 | t.Fatalf("Found unexpected field %v", result1) |
| 132 | } |
| 133 | |
| 134 | // existing field name |
| 135 | result2 := testFieldsList.GetByName("test2") |
| 136 | if result2 == nil || result2.GetName() != "test2" { |
| 137 | t.Fatalf("Cannot find field with name %q, got %v ", "test2", result2) |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | func TestFieldsListRemove(t *testing.T) { |
| 142 | testFieldsList := core.NewFieldsList( |
nothing calls this directly
no test coverage detected
searching dependent graphs…