corso/src/pkg/services/m365/m365_test.go
Vaibhav Kamra 16ad25f3a1
Implement wrapper around M365 helper methods (#825)
## Description

Exports functionality useful for external services/validators

## Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [ ] 🐹 Trivial/Minor

## Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
2022-09-13 10:32:02 +00:00

41 lines
773 B
Go

package m365
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/alcionai/corso/src/internal/tester"
)
type M365IntegrationSuite struct {
suite.Suite
}
func TestM365IntegrationSuite(t *testing.T) {
if err := tester.RunOnAny(
tester.CorsoCITests,
); err != nil {
t.Skip(err)
}
suite.Run(t, new(M365IntegrationSuite))
}
func (suite *M365IntegrationSuite) SetupSuite() {
_, err := tester.GetRequiredEnvSls(
tester.M365AcctCredEnvs)
require.NoError(suite.T(), err)
}
func (suite *M365IntegrationSuite) TestUsers() {
acct := tester.NewM365Account(suite.T())
users, err := Users(acct)
require.NoError(suite.T(), err)
require.NotNil(suite.T(), users)
require.Greater(suite.T(), len(users), 0)
}