Skip to content

Commit

Permalink
Implements testing for encryption and decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashy5000 committed Apr 1, 2024
1 parent 895fbe9 commit 97bba32
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions encryption_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package main

import (
"testing"

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

func TestEncryptKey(t *testing.T) {
t.Run("It encrypts the key.json file", func(t *testing.T) {
// Act
EncryptKey("0123456789abcdef")
// Assert
assert.True(t, IsKeyEncrypted())
DecryptKey("0123456789abcdef")
})
}

func TestDecryptKey(t *testing.T) {
t.Run("It decrypts the key.json file", func(t *testing.T) {
// Arrange
EncryptKey("0123456789abcdef")
// Act
DecryptKey("0123456789abcdef")
// Assert
assert.False(t, IsKeyEncrypted())
})
}

0 comments on commit 97bba32

Please sign in to comment.