@@ -116,6 +116,40 @@ public void TokenIdAndAccountIdMismatch()
116
116
Assert . Equal ( 1 , tenantsInAccount . Length ) ;
117
117
Assert . Equal ( tenants . First ( ) , tenantsInAccount [ 0 ] ) ;
118
118
}
119
+
120
+ [ Fact ]
121
+ [ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
122
+ public void AdalExceptionsArePropagatedToCaller ( )
123
+ {
124
+ var tenants = new List < string > { Guid . NewGuid ( ) . ToString ( ) , DefaultTenant . ToString ( ) } ;
125
+ var secondsubscriptionInTheFirstTenant = Guid . NewGuid ( ) . ToString ( ) ;
126
+ var firstList = new List < string > { DefaultSubscription . ToString ( ) , secondsubscriptionInTheFirstTenant } ;
127
+ var secondList = new List < string > { Guid . NewGuid ( ) . ToString ( ) } ;
128
+ var thirdList = new List < string > { DefaultSubscription . ToString ( ) , secondsubscriptionInTheFirstTenant } ;
129
+ var fourthList = new List < string > { DefaultSubscription . ToString ( ) , secondsubscriptionInTheFirstTenant } ;
130
+ var client = SetupTestEnvironment ( tenants , firstList , secondList , thirdList , fourthList ) ;
131
+
132
+ var tokens = new Queue < MockAccessToken > ( ) ;
133
+ tokens . Enqueue ( new MockAccessToken
134
+ {
135
+
136
+ LoginType = LoginType . OrgId ,
137
+ AccessToken = "bbb"
138
+ } ) ;
139
+
140
+ ( ( MockTokenAuthenticationFactory ) AzureSession . AuthenticationFactory ) . TokenProvider = ( account , environment , tenant ) =>
141
+ {
142
+ throw new AadAuthenticationCanceledException ( "Login window was closed" , null ) ;
143
+ } ;
144
+
145
+ Assert . Throws < AadAuthenticationCanceledException > ( ( ) => client . Login (
146
+ Context . Account ,
147
+ Context . Environment ,
148
+ null ,
149
+ secondsubscriptionInTheFirstTenant ,
150
+ null ,
151
+ null ) ) ;
152
+ }
119
153
120
154
[ Fact ]
121
155
[ Trait ( Category . AcceptanceType , Category . CheckIn ) ]
0 commit comments