| 1 |
// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 |
// Licensed under the MIT License. See LICENSE in the project root for license information. |
| 3 |
|
| 4 |
//go:build darwin && cgo |
| 5 |
// +build darwin,cgo |
| 6 |
|
| 7 |
package accessor |
| 8 |
|
| 9 |
import ( |
| 10 |
"testing" |
| 11 |
|
| 12 |
"github.com/stretchr/testify/require" |
| 13 |
) |
| 14 |
|
| 15 |
func TestWithAccount(t *testing.T) { |
| 16 |
if !manualTests { |
| 17 |
t.Skipf("set %s to run this test", msalextManualTest) |
| 18 |
} |
| 19 |
account := "account" |
| 20 |
a, err := New(t.Name(), WithAccount(account)) |
| 21 |
require.NoError(t, err) |
| 22 |
|
| 23 |
expected := []byte("expected") |
| 24 |
err = a.Write(ctx, expected) |
| 25 |
require.NoError(t, err) |
| 26 |
|
| 27 |
actual, err := a.Read(ctx) |
| 28 |
require.NoError(t, err) |
| 29 |
require.Equal(t, expected, actual) |
| 30 |
|
| 31 |
require.NoError(t, a.Delete(ctx)) |
| 32 |
} |