File: darwin_test.go

package info (click to toggle)
golang-github-azuread-microsoft-authentication-extensions-for-go 0.0~git20231002.7e3b8e2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 260 kB
  • sloc: makefile: 4
file content (32 lines) | stat: -rw-r--r-- 707 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

//go:build darwin && cgo
// +build darwin,cgo

package accessor

import (
	"testing"

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

func TestWithAccount(t *testing.T) {
	if !manualTests {
		t.Skipf("set %s to run this test", msalextManualTest)
	}
	account := "account"
	a, err := New(t.Name(), WithAccount(account))
	require.NoError(t, err)

	expected := []byte("expected")
	err = a.Write(ctx, expected)
	require.NoError(t, err)

	actual, err := a.Read(ctx)
	require.NoError(t, err)
	require.Equal(t, expected, actual)

	require.NoError(t, a.Delete(ctx))
}