Пример #1
0
        public void TestSaveRandomResultsMultiProject()
        {
            IInputFile         inputFile1  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile1);
            IInputFile         inputFile2  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile2);
            IInputFile         inputFile3  = Util.FindInputFile(_project2.GetInputFiles(), _testDataFile3);
            IList <IDataBlock> dataBlocks1 = _project1.GetDataBlocks(inputFile1);
            IList <IDataBlock> dataBlocks2 = _project1.GetDataBlocks(inputFile2);
            IList <IDataBlock> dataBlocks3 = _project2.GetDataBlocks(inputFile3);
            IResultNode        results12   = TestFramework.GetResults(dataBlocks1[2]);
            IResultNode        results20   = TestFramework.GetResults(dataBlocks2[0]);
            IResultNode        results30   = TestFramework.GetResults(dataBlocks3[0]);

            IResultNode[] results = new IResultNode[5];
            results[0] = results30.Children[4].ShallowCopy();
            results[1] = results20.Children[0].ShallowCopy();
            results[2] = results12.Children[0].ShallowCopy();
            results[3] = results30.Children[1].ShallowCopy();
            results[4] = results20.Children[0].ShallowCopy();
            TestFramework.WriteResults(results, _testOutputFile);
            byte[] contents = new byte[57];
            Array.Copy(_fullFile3, 60, contents, 0, 15);
            Array.Copy(_fullFile2, 0, contents, 15, 5);
            Array.Copy(_fullFile1, 102, contents, 20, 17);
            Array.Copy(_fullFile3, 15, contents, 37, 15);
            Array.Copy(_fullFile2, 0, contents, 52, 5);
            Util.AssertArrayEqualsFile(contents, _testOutputFile);
        }
Пример #2
0
        public void TestWriteRandomResultsFile1()
        {
            IInputFile         inputFile  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile1);
            IList <IDataBlock> dataBlocks = _project1.GetDataBlocks(inputFile);
            IResultNode        results0   = TestFramework.GetResults(dataBlocks[0]);
            IResultNode        results1   = TestFramework.GetResults(dataBlocks[1]);
            IResultNode        results2   = TestFramework.GetResults(dataBlocks[2]);
            IResultNode        results3   = TestFramework.GetResults(dataBlocks[3]);
            IResultNode        results4   = TestFramework.GetResults(dataBlocks[4]);

            IResultNode[] results = new IResultNode[5];
            results[0] = results0.Children[0].ShallowCopy();
            results[1] = results2.Children[0].ShallowCopy();
            results[2] = results4.Children[0].ShallowCopy();
            results[3] = results3.Children[0].ShallowCopy();
            results[4] = results1.Children[0].ShallowCopy();
            TestFramework.WriteResults(results, _testOutputFile);
            byte[] contents = new byte[85];
            Array.Copy(_fullFile1, 0, contents, 0, 17);
            Array.Copy(_fullFile1, 102, contents, 17, 17);
            Array.Copy(_fullFile1, 204, contents, 34, 17);
            Array.Copy(_fullFile1, 153, contents, 51, 17);
            Array.Copy(_fullFile1, 51, contents, 68, 17);
            Util.AssertArrayEqualsFile(contents, _testOutputFile);
        }
Пример #3
0
        public void TestWriteContiguousResultsFile2()
        {
            IInputFile         inputFile  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile2);
            IList <IDataBlock> dataBlocks = _project1.GetDataBlocks(inputFile);

            IResultNode[] results = (new List <IResultNode>(TestFramework.GetResults(dataBlocks[0]).Children)).ToArray();
            TestFramework.WriteResults(results, _testOutputFile);
            byte[] contents = new byte[255];
            Array.Copy(_fullFile2, contents, 255);
            Util.AssertArrayEqualsFile(contents, _testOutputFile);
        }
Пример #4
0
        public void TestWriteResultFile1()
        {
            IInputFile         inputFile  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile1);
            IList <IDataBlock> dataBlocks = _project1.GetDataBlocks(inputFile);
            IResultNode        results    = TestFramework.GetResults(dataBlocks[1]);

            results = results.Children[0];
            IResultNode[] result = new IResultNode[1];
            result[0] = results.Children[0].ShallowCopy();
            TestFramework.WriteResults(result, _testOutputFile);
            byte[] contents = new byte[17];
            Array.Copy(_fullFile1, 4 * 17, contents, 0, 17);
            Util.AssertArrayEqualsFile(contents, _testOutputFile);
        }
Пример #5
0
        public void TestSaveRandomResultsMultiFile()
        {
            IInputFile         inputFile1  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile1);
            IInputFile         inputFile2  = Util.FindInputFile(_project1.GetInputFiles(), _testDataFile2);
            IList <IDataBlock> dataBlocks1 = _project1.GetDataBlocks(inputFile1);
            IList <IDataBlock> dataBlocks2 = _project1.GetDataBlocks(inputFile2);
            IResultNode        results11   = TestFramework.GetResults(dataBlocks1[1]);
            IResultNode        results13   = TestFramework.GetResults(dataBlocks1[3]);
            IResultNode        results20   = TestFramework.GetResults(dataBlocks2[0]);

            IResultNode[] results = new IResultNode[3];
            results[0] = results11.Children[0].ShallowCopy();
            results[1] = results20.Children[0].ShallowCopy();
            results[2] = results13.Children[0].ShallowCopy();
            TestFramework.WriteResults(results, _testOutputFile);
            byte[] contents = new byte[39];
            Array.Copy(_fullFile1, 51, contents, 0, 17);
            Array.Copy(_fullFile2, 0, contents, 17, 5);
            Array.Copy(_fullFile1, 153, contents, 22, 17);
            Util.AssertArrayEqualsFile(contents, _testOutputFile);
        }