Ejemplo n.º 1
0
        public void ValidateOperatorFileInfo()
        {
            OutputFile outputFile = new OutputFile();

            string filename = Path.GetTempFileName();
            using (File.Create(filename)) { };
            FileInfo fileinfo = new FileInfo(filename);

            outputFile = fileinfo;

            try
            {
                fileinfo = outputFile;
                Assert.IsNotNull(fileinfo, "OutputFile BVT: OutputFile Operator FileInfo Validated successfully");
                outputFile = null;
                fileinfo = outputFile;
                Assert.IsNull(fileinfo, "OutputFile BVT: OutputFile Operator FileInfo Validated successfully");
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "OutputFile BVT: OutputFile FileInfo not validated successfully:", ex.Message));
                Assert.Fail("OutputFile BVT: OutputFile FileInfo not validated successfully");
            }
        }
        public void ValidateEnumerateValuesOfTypeFromParsable()
        {
            int num = 5;
            object obj = num;
            IEnumerable<int> integers = ArgumentCollection.EnumerateValuesOfTypeFromParsable<int>(obj);
            Assert.AreEqual(5, integers.ElementAt(0));
            Assert.AreEqual(null, ArgumentCollection.EnumerateValuesOfTypeFromParsable<int>(null));

            OutputFile outFile = new OutputFile();
            outFile.FullName = "Outfile";
            obj = outFile;
            IEnumerable<OutputFile> outFiles = ArgumentCollection.EnumerateValuesOfTypeFromParsable<OutputFile>(obj);
            Assert.AreEqual("Outfile", outFiles.ElementAt(0).FullName);

            IEnumerable<ParsableFile> parsableFiles = ArgumentCollection.EnumerateValuesOfTypeFromParsable<ParsableFile>(obj);
            Assert.AreEqual("Outfile", parsableFiles.ElementAt(0).FullName);
        }
Ejemplo n.º 3
0
        public void ValidateFinalizeParse()
        {
            OutputFile outputFile = new OutputFile();
            string filename = Path.GetTempFileName();

            // Create temp files
            using (File.Create(filename)) { }

            try
            {
                outputFile.FullName = filename;
                outputFile.FinalizeParse();
                ApplicationLog.WriteLine("OutputFile BVT: OutputFile FinalizeParse Validated successfully");
            }
            catch (Exception ex)
            {
                ApplicationLog.WriteLine(string.Format((IFormatProvider)null,
                    "OutputFile BVT: OutputFile FinalizeParse Validated successfully:", ex.Message));
                Assert.Fail("OutputFile BVT: OutputFile FinalizeParse Not validated successfully");
            }
        }