From 837cd32d01787ac729c880722c3d68bc499dbb09 Mon Sep 17 00:00:00 2001 From: santhoshatdell Date: Fri, 13 Sep 2024 20:59:34 +0000 Subject: [PATCH] Added unit test --- gopowerstore_types_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gopowerstore_types_test.go b/gopowerstore_types_test.go index b2b01af..61fcfed 100644 --- a/gopowerstore_types_test.go +++ b/gopowerstore_types_test.go @@ -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. @@ -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()) +}