package Ġchat . wil low . war ren . handler . r pl . is upport Ċ Ċ import Ġchat . wil low . k ale . helper . Case Mapping Ċ import Ġchat . wil low . k ale . irc . message . rfc 1 4 5 9 . r pl . R pl 0 0 5 Message Ċ import Ġchat . wil low . k ale . irc . tag . Tag Store Ċ import Ġchat . wil low . war ren . extension . cap . IC ap Manager Ċ import Ġchat . wil low . war ren . extension . monitor . Monitor State Ċ import Ġchat . wil low . war ren . state .* Ċ import Ġcom . n ha ar man . mockito _ kotlin . mock Ċ import Ġcom . n ha ar man . mockito _ kotlin . verify Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ class ĠR pl 0 0 5 Handler Tests Ġ{ ĊĠĠĠ Ġlateinit Ġvar Ġhandler : ĠR pl 0 0 5 Handler ĊĠĠĠ Ġlateinit Ġvar Ġstate : ĠParsing State ĊĠĠĠ Ġlateinit Ġvar Ġuser Prefixes State : ĠUser Prefixes State ĊĠĠĠ Ġlateinit Ġvar Ġchannel Modes State : ĠChannel Modes State ĊĠĠĠ Ġlateinit Ġvar Ġchannel Types State : ĠChannel Types State ĊĠĠĠ Ġlateinit Ġvar Ġcase Mapping State : ĠCase Mapping State ĊĠĠĠ Ġlateinit Ġvar Ġmonitor State : ĠMonitor State ĊĠĠĠ Ġlateinit Ġvar Ġmock Cap Manager : ĠI Cap Manager ĊĠĠĠ Ġlateinit Ġvar Ġmock Prefix Handler : ĠIR pl 0 0 5 Prefix Handler ĊĠĠĠ Ġlateinit Ġvar Ġmock Channel Modes Handler : ĠIR pl 0 0 5 Chan Modes Handler ĊĠĠĠ Ġlateinit Ġvar Ġmock Channel Types Handler : ĠIR pl 0 0 5 Chan Types Handler ĊĠĠĠ Ġlateinit Ġvar Ġmock Case Mapping Handler : ĠIR pl 0 0 5 Case Mapping Handler ĊĠĠĠ Ġlateinit Ġvar Ġmock Monitor Handler : ĠIR pl 0 0 5 Monitor Handler ĊĊĠĠĠ Ġ@ Before Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġuser Prefixes State Ġ= ĠUser Prefixes State ( prefixes To Modes Ġ= Ġmap Of ('@ ' Ġto Ġ' o ')) ĊĠĠĠĠĠĠĠ Ġchannel Modes State Ġ= ĠChannel Modes State ( type A Ġ= Ġset Of (' a '), Ġtype B Ġ= Ġset Of (' b '), Ġtype C Ġ= Ġset Of (' c '), Ġtype D Ġ= Ġset Of (' d ')) ĊĠĠĠĠĠĠĠ Ġchannel Types State Ġ= ĠChannel Types State ( types Ġ= Ġset Of ('# ')) ĊĠĠĠĠĠĠĠ Ġcase Mapping State Ġ= ĠCase Mapping State ( mapping Ġ= ĠCase Mapping . RFC 1 4 5 9 ) ĊĠĠĠĠĠĠĠ Ġmonitor State Ġ= ĠMonitor State ( max Count Ġ= Ġ 0 ) ĊĠĠĠĠĠĠĠ Ġstate Ġ= ĠParsing State ( user Prefixes State , Ġchannel Modes Ġ= Ġchannel Modes State , Ġchannel Types Ġ= Ġchannel Types State , Ġcase Mapping Ġ= Ġcase Mapping State ) ĊĠĠĠĠĠĠĠ Ġmock Prefix Handler Ġ= Ġmock () ĊĠĠĠĠĠĠĠ Ġmock Cap Manager Ġ= Ġmock () ĊĠĠĠĠĠĠĠ Ġmock Channel Modes Handler Ġ= Ġmock () ĊĠĠĠĠĠĠĠ Ġmock Channel Types Handler Ġ= Ġmock () ĊĠĠĠĠĠĠĠ Ġmock Case Mapping Handler Ġ= Ġmock () ĊĠĠĠĠĠĠĠ Ġmock Monitor Handler Ġ= Ġmock () ĊĠĠĠĠĠĠĠ Ġhandler Ġ= ĠR pl 0 0 5 Handler ( state , Ġmonitor State , Ġmock Prefix Handler , Ġmock Channel Modes Handler , Ġmock Channel Types Handler , Ġmock Case Mapping Handler , Ġmock Monitor Handler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġtest _ handle _ User Prefixes () Ġ{ ĊĠĠĠĠĠĠĠ Ġhandler . handle ( R pl 0 0 5 Message . Message ( source Ġ= Ġ" test . server ", Ġtarget Ġ= Ġ" test _ user ", Ġtokens Ġ= Ġmap Of (" PREFIX " Ġto Ġ"( ov h ) @ +% ")), ĠTag Store ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( mock Prefix Handler ). handle ("( ov h ) @ + %", Ġuser Prefixes State ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġtest _ handle _ Channel Modes () Ġ{ ĊĠĠĠĠĠĠĠ Ġhandler . handle ( R pl 0 0 5 Message . Message ( source Ġ= Ġ" test . server ", Ġtarget Ġ= Ġ" test _ user ", Ġtokens Ġ= Ġmap Of (" CHAN MODES " Ġto Ġ" e Ib , k , l , im np st Sr ")), ĠTag Store ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( mock Channel Modes Handler ). handle (" e Ib , k , l , im np st Sr ", Ġchannel Modes State ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġtest _ handle _ Case Mapping () Ġ{ ĊĠĠĠĠĠĠĠ Ġhandler . handle ( R pl 0 0 5 Message . Message ( source Ġ= Ġ" test . server ", Ġtarget Ġ= Ġ" test _ user ", Ġtokens Ġ= Ġmap Of (" CASE MAPPING " Ġto Ġ" something ")), ĠTag Store ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( mock Case Mapping Handler ). handle (" something ", Ġcase Mapping State ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test Ġfun Ġtest _ handle _ Monitor () Ġ{ ĊĠĠĠĠĠĠĠ Ġhandler . handle ( R pl 0 0 5 Message . Message ( source Ġ= Ġ" test . server ", Ġtarget Ġ= Ġ" test _ user ", Ġtokens Ġ= Ġmap Of (" MONITOR " Ġto Ġ" 1 2 3 4 ")), ĠTag Store ()) ĊĊĠĠĠĠĠĠĠ Ġverify ( mock Monitor Handler ). handle (" 1 2 3 4 ", Ġmonitor State ) ĊĠĠĠ Ġ} Ċ Ċ }