public void TestBinSingleEndBam()
{
string assemblyFolder = Isas.Shared.Utilities.GetAssemblyFolder(typeof(TestCanvasBin));
string dataFolder = Path.Combine(assemblyFolder, "Data");
string bedPath = Path.Combine(dataFolder, "bins_chrM.bed");
string bamPath = Path.Combine(dataFolder, "single-end.bam");
Dictionary<string, List<GenomicBin>> bins = CanvasCommon.Utilities.LoadBedFile(bedPath, gcIndex: 3);
string chrom = "chrM";
FragmentBinner.BinTask binTask = new FragmentBinner.BinTask(null, chrom, bamPath, bins[chrom]);
bool exceptionCaught = false;
try
{
binTask.DoIt();
}
catch (ApplicationException e)
{
if (e.Message.Contains("No paired alignments found"))
exceptionCaught = true;
}
Assert.IsTrue(exceptionCaught);
}