@@ -92,9 +92,32 @@ func TestVcsProvidersCreate(t *testing.T) {
9292 assert .Equal (t , * options .Name , item .Name )
9393 assert .Equal (t , options .VcsType , item .VcsType )
9494 assert .Equal (t , options .AuthType , item .AuthType )
95+ assert .Equal (t , false , item .IsShared )
9596 }
9697 })
9798
99+ t .Run ("shared provider" , func (t * testing.T ) {
100+ options := VcsProviderCreateOptions {
101+ Name : String ("vcs-" + randomString (t )),
102+ VcsType : Github ,
103+ AuthType : PersonalToken ,
104+ Token : os .Getenv ("GITHUB_TOKEN" ),
105+ IsShared : Bool (true ),
106+
107+ Account : & Account {ID : defaultAccountID },
108+ }
109+
110+ vcs , err := client .VcsProviders .Create (ctx , options )
111+ require .NoError (t , err )
112+
113+ assert .NotEmpty (t , vcs .ID )
114+ assert .Equal (t , * options .Name , vcs .Name )
115+ assert .Equal (t , options .VcsType , vcs .VcsType )
116+ assert .Equal (t , options .AuthType , vcs .AuthType )
117+ assert .Equal (t , * options .IsShared , vcs .IsShared )
118+
119+ })
120+
98121 t .Run ("with agent-pool attr vcs-enabled: false" , func (t * testing.T ) {
99122 ap , apCleanup := createAgentPool (t , client , false )
100123 defer apCleanup ()
@@ -186,14 +209,16 @@ func TestVcsProvidersUpdate(t *testing.T) {
186209
187210 t .Run ("when updating a subset of values" , func (t * testing.T ) {
188211 options := VcsProviderUpdateOptions {
189- Name : String (randomString (t )),
212+ Name : String (randomString (t )),
213+ IsShared : Bool (true ),
190214 }
191215
192216 vcsAfter , err := client .VcsProviders .Update (ctx , vcsTest .ID , options )
193217 require .NoError (t , err )
194218
195219 assert .Equal (t , vcsTest .AuthType , vcsAfter .AuthType )
196220 assert .Equal (t , vcsTest .VcsType , vcsAfter .VcsType )
221+ assert .True (t , vcsTest .IsShared != vcsAfter .IsShared )
197222 })
198223
199224 t .Run ("with valid options" , func (t * testing.T ) {
0 commit comments