示例#1
0
        public void GetFileData_No_Argument()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "f:/test.txt"
            };

            var result = manager.GetFileData(arguments);

            Assert.AreEqual("No valid input", result);
        }
示例#2
0
        public void GetFileData_No_Valid_File_Path()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--size",
            };

            var result = manager.GetFileData(arguments);

            Assert.AreEqual("No valid input", result);
        }
示例#3
0
        public void GetFileData_Version_Third_Pattern()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--v",
                "f:/test.txt"
            };

            var result = manager.GetFileData(arguments);

            Assert.IsTrue(result.Contains("File version:"));
        }
示例#4
0
        public void GetFileData_Verions_Mixed_case_Invalid_Symbol()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--VeRsiOn//",
                "f:/test.txt",
            };

            var result = manager.GetFileData(arguments);

            Assert.IsTrue(result.Contains("Invalid argument(s) supplied"));
        }
示例#5
0
        public void GetFileData_Verions_Mixed_case()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--VeRsiOn",
                "f:/test.txt",
            };

            var result = manager.GetFileData(arguments);

            Assert.IsTrue(result.Contains("File version:"));
        }
示例#6
0
        public void GetFileData_Size()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "-S",
                "f:/test.txt"
            };

            var result = manager.GetFileData(arguments);

            Assert.IsTrue(result.Contains("File size:"));
        }
示例#7
0
        public void GetFileData_No_Valid_Argument()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "----R",
                "f:/test.txt"
            };

            var result = manager.GetFileData(arguments);

            Assert.IsTrue(result.Contains("Invalid argument(s) supplied"));
        }
示例#8
0
        public void GetFileData_More_File_Paths()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--VeRsiOn//",
                "f:/test.txt",
                "f:/test.txt",
                "f:/test.txt",
            };

            var result = manager.GetFileData(arguments);

            Assert.AreEqual("No valid input", result);
        }
示例#9
0
        public void GetFileData_Verions_Size_Arugments_Different_Position()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--version",
                "f:/test.txt",
                "--size"
            };

            var result = manager.GetFileData(arguments);

            Assert.IsTrue(result.Contains("File version:"));
            Assert.IsTrue(result.Contains("File size:"));
        }
示例#10
0
        public void GetFileData_Verions_Size_More_Arguments()
        {
            FileDetails     fileDetails = new FileDetails();
            FileDataManager manager     = new FileDataManager(fileDetails);

            var arguments = new string[] {
                "--version",
                "f:/test.txt",
                "--size",
                "--size",
                "--size",
            };

            var result = manager.GetFileData(arguments);

            Assert.AreEqual("No valid input", result);
        }