Test Setup Failed
Push — main ( 65658e...e4024b )
by Acho
02:13
created

cipher_service_test.go   A

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A httpsms.TestCipherService 0 14 1
1
package httpsms
2
3
import (
4
	"github.com/stretchr/testify/assert"
5
	"testing"
6
)
7
8
func TestCipherService(t *testing.T) {
9
	// Arrange
10
	key := "Password123"
11
	message := "This is a test text message"
12
	client := New()
13
14
	// Act
15
	encryptedMessage, encryptErr := client.Cipher.Encrypt(key, message)
16
	decryptedMessage, decryptErr := client.Cipher.Decrypt(key, encryptedMessage)
17
18
	// Assert
19
	assert.Nil(t, encryptErr)
20
	assert.Nil(t, decryptErr)
21
	assert.Equal(t, message, decryptedMessage)
22
}
23