Exemplo n.º 1
0
        public static void ClassInitialize(TestContext context)
        {
            // calculate indices
            var recordingPath = PathHelper.ResolveAsset("Recordings", "OxleyCreek_site_1_1060_244333_20140529T081358+1000_120_0.wav");
            var configPath    = PathHelper.ResolveConfigFile("Towsey.Acoustic.Zooming.yml");
            var arguments     = new AnalyseLongRecording.Arguments
            {
                Source  = recordingPath,
                Config  = configPath.FullName,
                Output  = SharedDirectory,
                TempDir = SharedDirectory.Combine("Temp"),
            };

            context.WriteLine($"{DateTime.Now} generating indices fixture data");
            AnalyseLongRecording.Execute(arguments);
            context.WriteLine($"{DateTime.Now} finished generting fixture");

            ResultsDirectory = SharedDirectory.Combine("Towsey.Acoustic");

            // do some basic checks that the indices were generated
            var listOfFiles = ResultsDirectory.EnumerateFiles().ToArray();

            Assert.AreEqual(20, listOfFiles.Length);
            var csvCount = listOfFiles.Count(f => f.Name.EndsWith(".csv"));

            Assert.AreEqual(16, csvCount);
            var jsonCount = listOfFiles.Count(f => f.Name.EndsWith(".json"));

            Assert.AreEqual(2, jsonCount);
            var pngCount = listOfFiles.Count(f => f.Name.EndsWith(".png"));

            Assert.AreEqual(2, pngCount);
        }
        public static void MyClassInitialize(TestContext testContext)
        {
            var indonesiaIndices  = PathHelper.ResolveAsset("Concatenation", IndonesiaReduced + ".zip");
            var newZealandIndices = PathHelper.ResolveAsset("Concatenation", NewZealandArk01 + ".zip");

            indonesiaIndicesDirectory       = SharedDirectory.Combine(IndonesiaReduced);
            newZealandArk01IndicesDirectory = SharedDirectory.Combine(NewZealandArk01);

            ZipFile.ExtractToDirectory(indonesiaIndices.FullName, indonesiaIndicesDirectory.FullName);
            ZipFile.ExtractToDirectory(newZealandIndices.FullName, newZealandArk01IndicesDirectory.FullName);
        }