(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func TestFieldsListGetById(t *testing.T) { |
| 106 | f1 := &core.TextField{Id: "id1", Name: "test1"} |
| 107 | f2 := &core.EmailField{Id: "id2", Name: "test2"} |
| 108 | testFieldsList := core.NewFieldsList(f1, f2) |
| 109 | |
| 110 | // missing field id |
| 111 | result1 := testFieldsList.GetById("test1") |
| 112 | if result1 != nil { |
| 113 | t.Fatalf("Found unexpected field %v", result1) |
| 114 | } |
| 115 | |
| 116 | // existing field id |
| 117 | result2 := testFieldsList.GetById("id2") |
| 118 | if result2 == nil || result2.GetId() != "id2" { |
| 119 | t.Fatalf("Cannot find field with id %q, got %v ", "id2", result2) |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | func TestFieldsListGetByName(t *testing.T) { |
| 124 | f1 := &core.TextField{Id: "id1", Name: "test1"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…