Skip to content

Commit

Permalink
image history enum test (#47)
Browse files Browse the repository at this point in the history
adds tests for image history enum
tests both valid and invalid cases

---

### **Checklist**
- [x] Tests added/updated
- [ ] Documentation updated (if needed)
- [x] Code conforms to style guidelines
  • Loading branch information
amritakohli authored Dec 19, 2024
1 parent 5bf9e3e commit 334d766
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions toolkit/tools/imagecustomizerapi/imagehistory_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

package imagecustomizerapi

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestImageHistoryIsValidValid(t *testing.T) {
err := ImageHistoryNone.IsValid()
assert.NoError(t, err)
}

func TestImageHistoryIsValidInvalid(t *testing.T) {
err := ImageHistory("aaa").IsValid()
assert.ErrorContains(t, err, "invalid imageHistory value (aaa)")
}

0 comments on commit 334d766

Please sign in to comment.