public static void SettingUnknownServiceThrowsException()
        {
            var options = default(BaseOptions);
            var args    = new[]
            {
                "nlu",
                "command",
                "-s",
                "foo"
            };
            var parser = Parser.Default.ParseArguments <TrainOptions>(args).WithParsed <TrainOptions>(o =>
            {
                options = o;
            });

            IConfiguration configuration = new ConfigurationBuilder()
                                           .Build();

            Action createTrainInstance = () => NLUClientFactory.CreateTrainInstance(options, configuration);

            createTrainInstance.Should().Throw <InvalidOperationException>().WithMessage("Invalid NLU provider type 'foo'.");
            Action createTestInstance = () => NLUClientFactory.CreateTestInstance(options, configuration);

            createTestInstance.Should().Throw <InvalidOperationException>().WithMessage("Invalid NLU provider type 'foo'.");
        }
Beispiel #2
0
 protected override INLUTestClient CreateNLUTestClient()
 {
     return(NLUClientFactory.CreateTestInstance(this.Options, this.Configuration, this.Options.SettingsPath));
 }