public MockSkillWebSocketAdapter(
     SkillWebSocketBotAdapter skillWebSocketBotAdapter,
     BotSettingsBase botSettingsBase,
     IWhitelistAuthenticationProvider whitelistAuthenticationProvider)
     : base(skillWebSocketBotAdapter, botSettingsBase, whitelistAuthenticationProvider)
 {
 }
 public BotController(
     IBot bot,
     BotSettingsBase botSettings,
     IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
     SkillWebSocketAdapter skillWebSocketAdapter)
     : base(bot, botSettings, botFrameworkHttpAdapter, skillWebSocketAdapter)
 {
 }
 public BotController(
     IBot bot,
     BotSettingsBase botSettings,
     IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
     SkillWebSocketAdapter skillWebSocketAdapter,
     IWhitelistAuthenticationProvider whitelistAuthenticationProvider)
     : base(bot, botSettings, botFrameworkHttpAdapter, skillWebSocketAdapter, whitelistAuthenticationProvider)
 {
 }
 public SkillController(
     IBot bot,
     BotSettingsBase botSettings,
     IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
     SkillWebSocketAdapter skillWebSocketAdapter)
 {
     _bot                     = bot ?? throw new ArgumentNullException(nameof(IBot));
     _botSettings             = botSettings ?? throw new ArgumentNullException(nameof(botSettings));
     _botFrameworkHttpAdapter = botFrameworkHttpAdapter ?? throw new ArgumentNullException(nameof(IBotFrameworkHttpAdapter));
     _skillWebSocketAdapter   = skillWebSocketAdapter;
 }
Example #5
0
        public SkillWebSocketAdapter(
            SkillWebSocketBotAdapter skillWebSocketBotAdapter,
            BotSettingsBase botSettingsBase,
            IWhitelistAuthenticationProvider whitelistAuthenticationProvider,
            IBotTelemetryClient botTelemetryClient = null)
        {
            _skillWebSocketBotAdapter        = skillWebSocketBotAdapter ?? throw new ArgumentNullException(nameof(skillWebSocketBotAdapter));
            _botSettingsBase                 = botSettingsBase ?? throw new ArgumentNullException(nameof(botSettingsBase));
            _whitelistAuthenticationProvider = whitelistAuthenticationProvider ?? throw new ArgumentNullException(nameof(whitelistAuthenticationProvider));
            _authenticationProvider          = new MsJWTAuthenticationProvider(_botSettingsBase.MicrosoftAppId);
            _authenticator = new Authenticator(_authenticationProvider, _whitelistAuthenticationProvider);

            _botTelemetryClient = botTelemetryClient ?? NullBotTelemetryClient.Instance;
            _stopWatch          = new Stopwatch();
        }
Example #6
0
        public SkillController(
            IBot bot,
            BotSettingsBase botSettings,
            IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
            SkillWebSocketAdapter skillWebSocketAdapter,
            IWhitelistAuthenticationProvider whitelistAuthenticationProvider)
        {
            _bot                             = bot ?? throw new ArgumentNullException(nameof(IBot));
            _botSettings                     = botSettings ?? throw new ArgumentNullException(nameof(botSettings));
            _botFrameworkHttpAdapter         = botFrameworkHttpAdapter ?? throw new ArgumentNullException(nameof(IBotFrameworkHttpAdapter));
            _whitelistAuthenticationProvider = whitelistAuthenticationProvider ?? throw new ArgumentNullException(nameof(whitelistAuthenticationProvider));
            _skillWebSocketAdapter           = skillWebSocketAdapter;

            _authenticationProvider = new MsJWTAuthenticationProvider(_botSettings.MicrosoftAppId);
            _authenticator          = new Authenticator(_authenticationProvider, _whitelistAuthenticationProvider);
        }
        public MockSkillController(
            IBot bot,
            BotSettingsBase botSettings,
            IBotFrameworkHttpAdapter botFrameworkHttpAdapter,
            SkillWebSocketAdapter skillWebSocketAdapter,
            HttpClient httpClient,
            string manifestFileOverride = null)
            : base(bot, botSettings, botFrameworkHttpAdapter, skillWebSocketAdapter)
        {
            HttpClient = httpClient;

            if (manifestFileOverride != null)
            {
                ManifestTemplateFilename = manifestFileOverride;
            }
        }
Example #8
0
        public void TestInitialize()
        {
            _mockHttp = new MockHttpMessageHandler();

            _botSettings = new BotSettingsBase();
            _botSettings.MicrosoftAppId       = Guid.NewGuid().ToString();
            _botSettings.MicrosoftAppPassword = "******";

            // Initialise the Calendar LUIS model mock configuration
            _botSettings.CognitiveModels = new Dictionary <string, BotSettingsBase.CognitiveModelConfiguration>();
            var cogModelConfig = new BotSettingsBase.CognitiveModelConfiguration();

            cogModelConfig.LanguageModels = new List <Configuration.LuisService>();

            var luisModel = new Configuration.LuisService();

            luisModel.AuthoringKey    = "AUTHORINGKEY";
            luisModel.Id              = "Calendar";
            luisModel.Name            = "Calendar";
            luisModel.Region          = "westus";
            luisModel.Version         = "0.1";
            luisModel.SubscriptionKey = "SUBSCRIPTIONKEY";

            cogModelConfig.LanguageModels.Add(luisModel);
            _botSettings.CognitiveModels.Add("en", cogModelConfig);
            _botSettings.CognitiveModels.Add("de", cogModelConfig);
            _botSettings.CognitiveModels.Add("fr", cogModelConfig);

            _services = new ServiceCollection();

            _services.AddSingleton <SkillHttpAdapter, MockSkillHttpAdapter>();
            _services.AddSingleton <SkillHttpBotAdapter>();
            _services.AddSingleton <SkillWebSocketAdapter, MockSkillWebSocketAdapter>();
            _services.AddSingleton <SkillWebSocketBotAdapter>();
            _services.AddSingleton <IBotFrameworkHttpAdapter, MockBotFrameworkHttpAdapter>();
            _services.AddSingleton <IBot, MockBot>();
            _services.AddSingleton(_botSettings);
        }
Example #9
0
 public BotController(IServiceProvider serviceProvider, BotSettingsBase botSettings)
     : base(serviceProvider, botSettings)
 {
 }