コード例 #1
0
 public void LoadsTreeWithoutException()
 {
     using (var loader = new DivikResultLoader())
     {
         Assert.DoesNotThrow(code: () => loader.Load(_samplePath));
     }
 }
コード例 #2
0
        /// <summary>
        /// Entry point.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        public static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine(value: $"Usage: {AppDomain.CurrentDomain.FriendlyName} path_to_result_file");
                return;
            }

            var inputPath  = args.First();
            var outputPath = Path.ChangeExtension(inputPath, extension: "json");

            try
            {
                using (var loader = new DivikResultLoader())
                {
                    var tree = loader.Load(inputPath);
                    tree.Save(outputPath, indentation: false);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                throw;
            }
        }
コード例 #3
0
 public void LoadsAmplitudeFilterOfProperLength()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 2398, actual: tree.AmplitudeFilter.Length);
     }
 }
コード例 #4
0
 public void LoadsVarianceThreshold()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: float.NegativeInfinity, actual: tree.VarianceThreshold);
     }
 }
コード例 #5
0
 public void LoadsAmplitudeThreshold()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 12.3806, actual: tree.AmplitudeThreshold, delta: 0.001);
     }
 }
コード例 #6
0
 public void LoadedTreeIsNotNull()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.NotNull(tree);
     }
 }
コード例 #7
0
 public void LoadedSubregionsAreNotNullIfExisted()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.NotNull(anObject: tree.Subregions[0]);
     }
 }
コード例 #8
0
 public void LoadsSubregions()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 2, actual: tree.Subregions.Length);
     }
 }
コード例 #9
0
 public void LoadsMergedPartitionOfProperLength()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 7671, actual: tree.Merged.Length);
     }
 }