TestNewStorage is a simple test for NewStorage. If we implement in-memory our own, add more (table) tests
(t *testing.T)
| 12 | |
| 13 | // TestNewStorage is a simple test for NewStorage. If we implement in-memory our own, add more (table) tests |
| 14 | func TestNewStorage(t *testing.T) { |
| 15 | s, err := NewStorage() |
| 16 | assert.NoError(t, err) |
| 17 | |
| 18 | // Test to create new certification target |
| 19 | userInput := orchestratortest.NewCertificationTarget() |
| 20 | err = s.Create(userInput) |
| 21 | assert.NoError(t, err) |
| 22 | |
| 23 | // Test if we get same user via its name |
| 24 | userOutput := &orchestrator.CertificationTarget{} |
| 25 | err = s.Get(userOutput, "name = ?", testdata.MockCertificationTargetName1) |
| 26 | assert.NoError(t, err) |
| 27 | assert.NoError(t, api.Validate(userOutput)) |
| 28 | assert.Equal(t, userInput, userOutput) |
| 29 | } |
nothing calls this directly
no test coverage detected