コード例 #1
0
        public void Export_PhoneticSimilarity()
        {
            CogProject project  = CreateProject();
            var        exporter = new NexusSimilarityMatrixExporter();

            using (var stream = new MemoryStream())
            {
                exporter.Export(stream, project, SimilarityMetric.Phonetic);
                Assert.That(Encoding.UTF8.GetString(stream.ToArray()), Is.EqualTo(string.Format(NexusFileTemplate, 0.05, 0.15, 0.25)));
            }
        }
コード例 #2
0
        public void Export_EmptyProject()
        {
            var project  = new CogProject();
            var exporter = new NexusSimilarityMatrixExporter();

            using (var stream = new MemoryStream())
            {
                exporter.Export(stream, project, SimilarityMetric.Lexical);
                Assert.That(Encoding.UTF8.GetString(stream.ToArray()), Is.EqualTo(@"#NEXUS
BEGIN Taxa;
	DIMENSIONS NTax=0;
	TAXLABELS;
END;
BEGIN Distances;
	DIMENSIONS NTax=0;
	FORMAT Triangle=LOWER Diagonal Labels Missing=?;
	MATRIX;
END;
"));
            }
        }