Updates to add interface to onedrive package.

This commit is contained in:
Danny Adams 2023-01-06 16:13:44 -05:00
parent dd42105b3e
commit 886015126a
3 changed files with 19 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import (
"sync"
"testing"
absser "github.com/microsoft/kiota-abstractions-go/serialization"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
"github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/stretchr/testify/assert"
@ -36,6 +37,10 @@ func (suite *CollectionUnitTestSuite) Adapter() *msgraphsdk.GraphRequestAdapter
return nil
}
func (suite *CollectionUnitTestSuite) Serialize(object absser.Parsable) ([]byte, error) {
return nil, nil
}
func TestCollectionUnitTestSuite(t *testing.T) {
suite.Run(t, new(CollectionUnitTestSuite))
}

View File

@ -6,6 +6,7 @@ import (
"io"
"testing"
absser "github.com/microsoft/kiota-abstractions-go/serialization"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
"github.com/microsoftgraph/msgraph-sdk-go/models"
"github.com/stretchr/testify/require"
@ -34,6 +35,10 @@ func (suite *ItemIntegrationSuite) Adapter() *msgraphsdk.GraphRequestAdapter {
return suite.adapter
}
func (suite *ItemIntegrationSuite) Serialize(object absser.Parsable) ([]byte, error) {
return nil, nil
}
func TestItemIntegrationSuite(t *testing.T) {
tester.RunOnAny(
t,

View File

@ -3,6 +3,7 @@ package onedrive
import (
"testing"
absser "github.com/microsoft/kiota-abstractions-go/serialization"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
"github.com/stretchr/testify/require"
@ -22,6 +23,10 @@ func (ms *MockGraphService) Adapter() *msgraphsdk.GraphRequestAdapter {
return nil
}
func (ms *MockGraphService) Serialize(object absser.Parsable) ([]byte, error) {
return nil, nil
}
// TODO(ashmrtn): Merge with similar structs in graph and exchange packages.
type oneDriveService struct {
client msgraphsdk.GraphServiceClient
@ -38,6 +43,10 @@ func (ods *oneDriveService) Adapter() *msgraphsdk.GraphRequestAdapter {
return &ods.adapter
}
func (ods *oneDriveService) Serialize(object absser.Parsable) ([]byte, error) {
return nil, nil
}
func NewOneDriveService(credentials account.M365Config) (*oneDriveService, error) {
adapter, err := graph.CreateAdapter(
credentials.AzureTenantID,