/* Ċ Ġ* ĠCopyright Ġ 2 0 0 0 - 2 0 2 1 ĠJetBrains Ġs . r . o . Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġjet brains . build Server . dotnet . test . dot cover Ċ Ċ import Ġjet brains . build Server . Run Build Exception Ċ import Ġjet brains . build Server . agent . runner . Converter Ċ import Ġjet brains . build Server . dot cover . Coverage Filter Ċ import Ġjet brains . build Server . dot cover . Dot Cover Filter Converter Impl Ċ import Ġorg . testng . Assert Ċ import Ġorg . testng . annotations . DataProvider Ċ import Ġorg . testng . annotations . Test Ċ Ċ class ĠDot Cover Filter Converter Test Ġ{ ĊĠĠĠ Ġ@ DataProvider ( name Ġ= Ġ" filter Cases ") ĊĠĠĠ Ġfun Ġget Filter Cases (): ĠArray < Array < Any >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠarrayOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa ", Ġ"+ : aaa ; module = *; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa ; module = bbb ", Ġ"+ : aaa ; module = bbb ; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : bbb ", Ġ"- : bbb ; module = *; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("", Ġ"", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa $ our Line Separator - : module = bbb ", Ġ"+ : aaa ; module = *; class = *; function = *$ our Line Separator - : *; module = bbb ; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : module = aaa $ our Line Separator Ġ Ġ$ our Line Separator - : module = bbb ", Ġ"+ : *; module = aaa ; class = *; function = *$ our Line Separator - : *; module = bbb ; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ aaa $ our Line Separator - : bbb ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("$ our Line Separator - : bbb ", Ġ"- : bbb ; module = *; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ :$ our Line Separator - : bbb ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf (" +$ our Line Separator - : bbb ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf (" ?$ our Line Separator - : bbb ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa ;- : bbb ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa ,- : bbb ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa *$ our Line Separator - : b * bb ", Ġ"+ : aaa *; module = *; class = *; function = *$ our Line Separator - : b * bb ; module = *; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa *. dll $ our Line Separator - : b * bb ", Ġ"+ : aaa *. dll ; module = *; class = *; function = *$ our Line Separator - : b * bb ; module = *; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : module = aaa ; bbb ", Ġ"- : bbb ; module = aaa ; class = *; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : module = aaa ; class = bbb ", Ġ"- : *; module = aaa ; class = bbb ; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : module = aaa ; class = bbb ; ccc ", Ġ"- : ccc ; module = aaa ; class = bbb ; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : class = bbb ; module = aaa ", Ġ"- : *; module = aaa ; class = bbb ; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : module = aaa ; class = bbb ; function = ccc ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : function = ccc ; class = bbb ; module = aaa ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : function = ccc ; class = bbb ", Ġ"- : *; module = *; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : function = ccc ; class = bbb ; aaa ", Ġ"- : aaa ; module = *; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : ccc ; class = bbb ; module = aaa ", Ġ"- : ccc ; module = aaa ; class = bbb ; function = *", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : Assembly = aaa ; Class = bbb ; Function = ccc ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : Assembly = aaa ; Type = bbb ; Function = ccc ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : Assembly = aaa ; Type = bbb ; METHOD = ccc ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : Assembly = aaa ; Attribute = bbb ; METHOD = ccc ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : Assembly = aaa ; AttributeName = bbb ; METHOD = ccc ", Ġ"- : *; module = aaa ; class = bbb ; function = ccc ", Ġfalse ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("- : function = ccc ; bbb ; aaa ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf (" ?: aaa ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf (" aaa ", Ġ"", Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠarrayOf ("+ : aaa $ our Line Separator - : bb : b ", Ġ"", Ġtrue )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ( dataProvider Ġ= Ġ" filter Cases ") ĊĠĠĠ Ġfun Ġshould Parse Filter ( filter Str : ĠString , Ġexpected Filters Str : ĠString , Ġexpected Run Build Exception : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠGiven ĊĠĠĠĠĠĠĠ Ġval Ġinstance Ġ= Ġcreate Instance () ĊĠĠĠĠĠĠĠ Ġvar Ġactual Thrown Run Build Exception Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġvar Ġactual Filters Ġ= Ġempty List < Coverage Filter >() ĊĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġactual Filters Ġ= Ġinstance . convert ( filter Str ). toList () ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( ex : ĠRun Build Exception ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġactual Thrown Run Build Exception Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠAssert . assertEquals ( actual Thrown Run Build Exception , Ġexpected Run Build Exception ) ĊĠĠĠĠĠĠĠ Ġif Ġ(! actual Thrown Run Build Exception ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertEquals ( actual Filters . join ToString ( our Line Separator ) Ġ{ Ġit . toString () Ġ}, Ġexpected Filters Str ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Instance (): ĠConverter < String , ĠSequence < Coverage Filter >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠDot Cover Filter Converter Impl () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġour Line Separator Ġ= ĠSystem . getProperty (" line . separator ") ĊĠĠĠ Ġ} Ċ }