コード例 #1
0
        public void NullArgumentsTest()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var argResult = predictionCLI.LoadArguments(null);

            Assert.IsFalse(argResult);
        }
コード例 #2
0
        public void EmptyArgumentsTest()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var argResult = predictionCLI.LoadArguments(new string[] { });

            Assert.IsFalse(argResult);
        }
コード例 #3
0
        public void RunPrediction_Null()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            predictionCLI.LoadArguments(null);

            predictionCLI.RunPrediction();
        }
コード例 #4
0
        public void ValidateCL_Default()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var result = predictionCLI.ValidateCommandLine(new CommandLineParser.CommandLineArguments());

            Assert.IsFalse(result);
        }
コード例 #5
0
        public void ValidateCL_Null()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var result = predictionCLI.ValidateCommandLine(null);

            Assert.IsFalse(result);
        }
コード例 #6
0
        internal static void Run(string[] args)
        {
            var predictionCli = new PredictionCLI();

            if (!predictionCli.LoadArguments(args))
            {
                return;
            }

            predictionCli.RunPrediction();
        }
コード例 #7
0
        public void InitializedArgumentsInvalidEvaluateTest()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new List <string>
            {
                "-e"
            };

            var argResult = predictionCLI.LoadArguments(args.ToArray());

            Assert.IsFalse(argResult);
        }
コード例 #8
0
        public void ValidateCL_InitializedEvaluateInvalid()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new CommandLineParser.CommandLineArguments();

            args.Evaluate = true;
            args.PredictionDataFileName = null;

            var result = predictionCLI.ValidateCommandLine(args);

            Assert.IsFalse(result);
        }
コード例 #9
0
        public void ValidateCL_InitializedFully()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new CommandLineParser.CommandLineArguments();

            args.PredictionDataFileName = "test.txt";
            args.Evaluate             = true;
            args.Predictor            = "Warriors";
            args.TrainingDataFileName = "test.txt";

            var result = predictionCLI.ValidateCommandLine(args);

            Assert.IsTrue(result);
        }
コード例 #10
0
        public void RunPrediction_InitWithInvalidPredictor()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new List <string>
            {
                "-pd",
                "prediction.txt",
                "-pr",
                "wick"
            };

            predictionCLI.LoadArguments(args.ToArray());

            predictionCLI.RunPrediction();
        }
コード例 #11
0
        public void RunPrediction_InitWithActualModel_Predict()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new List <string>
            {
                "-pd",
                "prediction.txt",
                "-pr",
                new WarriorsPredictor().PredictorName
            };

            predictionCLI.LoadArguments(args.ToArray());

            predictionCLI.RunPrediction();
        }
コード例 #12
0
        public void RunPrediction_InitProperlyEvaluate()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new List <string>
            {
                "-pd",
                "test.txt",
                "-pr",
                new WarriorsPredictor().PredictorName,
                "-e"
            };

            predictionCLI.LoadArguments(args.ToArray());

            predictionCLI.RunPrediction();
        }
コード例 #13
0
        public void InitializedArgumentsValidTest()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new List <string>
            {
                "-pr",
                "warriors",
                "-pd",
                "test.txt",
                "-td",
                "test.txt",
                "-e"
            };

            var argResult = predictionCLI.LoadArguments(args.ToArray());

            Assert.IsTrue(argResult);
        }
コード例 #14
0
        public void ValidateCL_InitializedPredictionInvalid()
        {
            var predictionCLI = new PredictionCLI();

            Assert.IsNotNull(predictionCLI);

            var args = new CommandLineParser.CommandLineArguments();

            args.PredictionDataFileName = "test.txt";
            args.Predictor = null;

            var result = predictionCLI.ValidateCommandLine(args);

            Assert.IsFalse(result);

            args.Predictor = "warrior";
            args.PredictionDataFileName = null;

            result = predictionCLI.ValidateCommandLine(args);

            Assert.IsFalse(result);
        }