コード例 #1
0
        public void ParseTags_LessThanFourColumn_ThrowException()
        {
            const string tagLine = "#CHROM\tPOS\tREF\n";

            using (var caParser = new CustomAnnotationsParser(GetReadStream(tagLine), null))
            {
                Assert.Throws <UserErrorException>(() => caParser.ParseTags());
            }
        }
コード例 #2
0
        public void ParseTypes_InvalidType_ThrowException(string type)
        {
            string tagAndTypeLines = "#CHROM\tPOS\tREF\tALT\tValue\n" +
                                     $"#type\t.\t.\t.\t{type}";

            using (var caParser = new CustomAnnotationsParser(GetReadStream(tagAndTypeLines), null))
            {
                caParser.ParseTags();
                Assert.Throws <UserErrorException>(() => caParser.ParseTypes());
            }
        }
コード例 #3
0
        public void ParseTypes_ValidType_Pass(string type)
        {
            string tagAndTypeLines = "#CHROM\tPOS\tREF\tALT\tValue\n" +
                                     $"#type\t.\t.\t.\t{type}";

            using (var caParser = new CustomAnnotationsParser(GetReadStream(tagAndTypeLines), null))
            {
                caParser.ParseTags();
                caParser.ParseTypes();
            }
        }
コード例 #4
0
        public void CheckPosAndRefColumns_InvalidPosOrRef_ThrowException()
        {
            const string tagLine = "#CHROM\t\tREF\tALT\n";

            using (var caParser = new CustomAnnotationsParser(GetReadStream(tagLine), null))
            {
                Assert.Throws <UserErrorException>(() => caParser.ParseTags());
            }

            const string tagLine2 = "#CHROM\tPOS\tREFERENCE\tALT\n";

            using (var caParser = new CustomAnnotationsParser(GetReadStream(tagLine2), null))
            {
                Assert.Throws <UserErrorException>(() => caParser.ParseTags());
            }
        }