public async Task NoCallerIdShouldSetNullOAuthScope() { var mockCredentialProvider = new Mock <ICredentialProvider>(); var mockSocket = new Mock <WebSocket>(); var bot = new TestBot(null); var adapter = new MockAdapter(mockCredentialProvider.Object, bot); var originalActivity = CreateBasicActivity(); // Has no callerId, therefore OAuthScope in TurnState should be null. adapter.CreateStreamingRequestHandler(mockSocket.Object, originalActivity); await adapter.ProcessStreamingActivityAsync(originalActivity, bot.OnTurnAsync); }
public async Task PublicCloudCallerIdShouldSetCorrectOAuthScope() { var mockCredentialProvider = new Mock <ICredentialProvider>(); var mockSocket = new Mock <WebSocket>(); var oAuthScope = AuthenticationConstants.ToBotFromChannelTokenIssuer; var bot = new TestBot(oAuthScope); var adapter = new MockAdapter(mockCredentialProvider.Object, bot); var originalActivity = CreateBasicActivity(); originalActivity.CallerId = CallerIdConstants.PublicAzureChannel; adapter.CreateStreamingRequestHandler(mockSocket.Object, originalActivity, oAuthScope); await adapter.ProcessStreamingActivityAsync(originalActivity, bot.OnTurnAsync); }