Skip to content

Commit

Permalink
Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshatdell committed Sep 13, 2024
1 parent 0d49e3c commit 837cd32
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gopowerstore_types_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright © 2020-2022 Dell Inc. or its subsidiaries. All Rights Reserved.
* Copyright © 2020-2024 Dell Inc. or its subsidiaries. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,3 +53,12 @@ func TestAPIError_VolumeDetachedFromHost(t *testing.T) {
apiError := NewVolumeAttachedToHostError()
assert.True(t, apiError.VolumeDetachedFromHost())
}

func TestAPIError_ReplicationSessionAlreadyCreated(t *testing.T) {
apiError := NewAPIError()
apiError.StatusCode = http.StatusUnprocessableEntity
assert.False(t, apiError.ReplicationSessionAlreadyCreated())

apiError.StatusCode = http.StatusBadRequest
assert.True(t, apiError.ReplicationSessionAlreadyCreated())
}

0 comments on commit 837cd32

Please sign in to comment.