public void AddAndGetCandidates_Errors() { var testRegion = new MyRegionState(1000, 2000); Assert.Throws <ArgumentException>( () => testRegion.AddCandidate(new CandidateAllele("chr1", 999, "A", "T", AlleleCategory.Snv))); Assert.Throws <ArgumentException>( () => testRegion.GetAlleleCount(2001, AlleleType.A, DirectionType.Forward)); }
public void AddAndGetAlleleCounts() { var testRegion = new MyRegionState(1000, 2000); for (var i = 0; i < 5; i++) { testRegion.AddAlleleCount(1001, AlleleType.A, DirectionType.Forward); } for (var i = 0; i < 2; i++) { testRegion.AddAlleleCount(1001, AlleleType.C, DirectionType.Forward); } for (var i = 0; i < 12; i++) { testRegion.AddAlleleCount(1001, AlleleType.C, DirectionType.Reverse); } for (var i = 0; i < 15; i++) { testRegion.AddAlleleCount(2000, AlleleType.A, DirectionType.Stitched); } Assert.Equal(testRegion.GetAlleleCount(1001, AlleleType.A, DirectionType.Forward), 5); Assert.Equal(testRegion.GetAlleleCount(1001, AlleleType.C, DirectionType.Forward), 2); Assert.Equal(testRegion.GetAlleleCount(1001, AlleleType.C, DirectionType.Reverse), 12); Assert.Equal(testRegion.GetAlleleCount(2000, AlleleType.A, DirectionType.Stitched), 15); Assert.Equal(testRegion.GetAlleleCount(1000, AlleleType.A, DirectionType.Stitched), 0); Assert.Equal(testRegion.GetAlleleCount(1500, AlleleType.A, DirectionType.Forward), 0); }