public void LoadsTreeWithoutException()
 {
     using (var loader = new DivikResultLoader())
     {
         Assert.DoesNotThrow(code: () => loader.Load(_samplePath));
     }
 }
        /// <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;
            }
        }
 public void LoadsAmplitudeFilterOfProperLength()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 2398, actual: tree.AmplitudeFilter.Length);
     }
 }
 public void LoadsVarianceThreshold()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: float.NegativeInfinity, actual: tree.VarianceThreshold);
     }
 }
 public void LoadsAmplitudeThreshold()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 12.3806, actual: tree.AmplitudeThreshold, delta: 0.001);
     }
 }
 public void LoadedTreeIsNotNull()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.NotNull(tree);
     }
 }
 public void LoadedSubregionsAreNotNullIfExisted()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.NotNull(anObject: tree.Subregions[0]);
     }
 }
 public void LoadsSubregions()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 2, actual: tree.Subregions.Length);
     }
 }
 public void LoadsMergedPartitionOfProperLength()
 {
     using (var loader = new DivikResultLoader())
     {
         var tree = loader.Load(_samplePath);
         Assert.AreEqual(expected: 7671, actual: tree.Merged.Length);
     }
 }
 public void InitializesWithMcrBackend()
 {
     Assert.DoesNotThrow(
         code: () =>
     {
         using (var loader = new DivikResultLoader())
         { }
     });
 }