Skip to content

Commit

Permalink
devops: handle black-box testing
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Kungla <[email protected]>
  • Loading branch information
mkungla committed Nov 21, 2023
1 parent 740a558 commit 8d88d4e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions nfcsdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@
// Licensed under the Apache License, Version 2.0.
// See the LICENSE file.

package nfcsdk_test
package nfcsdk

import (
"testing"

"github.com/happy-sdk/nfcsdk"
)

func TestFormatByteSlice(t *testing.T) {
// Test case 1: An empty byte slice should return an empty string.
emptySlice := []byte{}
result := nfcsdk.FormatByteSlice(emptySlice)
result := FormatByteSlice(emptySlice)
expected := ""
if result != expected {
t.Errorf("Expected '%s', but got '%s'", expected, result)
}

// Test case 2: A byte slice with some data should be formatted as expected.
dataSlice := []byte{72, 101, 108, 108, 111} // ASCII values for "Hello"
result = nfcsdk.FormatByteSlice(dataSlice)
result = FormatByteSlice(dataSlice)
expected = "48:65:6C:6C:6F" // Hexadecimal representation of ASCII values
if result != expected {
t.Errorf("Expected '%s', but got '%s'", expected, result)
Expand Down

0 comments on commit 8d88d4e

Please sign in to comment.