package Ġpl . sr w . bill calculator . bill . calculation Ċ Ċ import Ġorg . junit . Test Ċ import Ġorg . th reet en . bp . LocalDate Ċ import Ġorg . th reet en . bp . Month Ċ Ċ import Ġjava . math . BigDecimal Ċ Ċ import Ġpl . sr w . bill calculator . db . T aur on Prices Ċ Ċ import Ġorg . hamcrest . Core Matchers .` is ` Ċ import Ġorg . junit . Assert . assertThat Ċ Ċ @ SuppressWarnings (" Long Method ") Ċ class ĠT aur on G 1 2 Calculated Bill Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġshould Calculate Bill With O pl ata Hand low a Disabled () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġprepare ĊĠĠĠĠĠĠĠ Ġval Ġprices Ġ= ĠT aur on Prices ( ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 L , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 4 . 0 4 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 5 . 0 5 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 6 . 0 6 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"- 1 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 7 . 0 7 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 8 . 0 8 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 9 . 0 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 1 1 . 1 1 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 . 0 0 " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġcalculate ĊĠĠĠĠĠĠĠ Ġval Ġsut Ġ= ĠT aur on G 1 2 Calculated Bill ( ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 5 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 4 5 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocalDate . of ( 2 0 1 5 , ĠMonth . J AN U ARY , Ġ 1 ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocalDate . of ( 2 0 1 5 , ĠMonth . OCT OB ER , Ġ 3 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprices ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġverify ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . day Consumption , Ġ` is `( 1 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . night Consumption , Ġ` is `( 2 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . total Consumption , Ġ` is `( 3 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . month Count , Ġ` is `( 1 0 )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Day Net Charge , Ġ` is `( BigDecimal (" 7 0 . 7 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Day Net Charge , Ġ` is `( BigDecimal (" 9 0 . 9 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Night Net Charge , Ġ` is `( BigDecimal (" 1 6 1 . 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Night Net Charge , Ġ` is `( BigDecimal (" 2 2 2 . 2 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Pr ze j sci owa Net Charge , Ġ` is `( BigDecimal (" 5 0 . 5 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na St ala Net Charge , Ġ` is `( BigDecimal (" 4 0 . 4 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Ab on ament owa Net Charge , Ġ` is `( BigDecimal (" 6 0 . 6 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Day V at Charge , Ġ` is `( BigDecimal (" 1 6 . 2 6 1 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Day V at Charge , Ġ` is `( BigDecimal (" 2 0 . 9 0 7 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Night V at Charge , Ġ` is `( BigDecimal (" 3 7 . 1 6 8 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Night V at Charge , Ġ` is `( BigDecimal (" 5 1 . 1 0 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Pr ze j sci owa V at Charge , Ġ` is `( BigDecimal (" 1 1 . 6 1 5 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na St ala V at Charge , Ġ` is `( BigDecimal (" 9 . 2 9 2 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Ab on ament owa V at Charge , Ġ` is `( BigDecimal (" 1 3 . 9 3 8 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . net Charge Sum , Ġ` is `( BigDecimal (" 6 9 6 . 9 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . vat Charge Sum , Ġ` is `( BigDecimal (" 1 6 0 . 2 9 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . g ross Charge Sum , Ġ` is `( BigDecimal (" 8 5 7 . 1 9 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . exc ise , Ġ` is `( BigDecimal (" 0 . 6 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell Net Charge , Ġ` is `( BigDecimal (" 2 3 2 . 3 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell V at Charge , Ġ` is `( BigDecimal (" 5 3 . 4 3 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell G ross Charge , Ġ` is `( BigDecimal (" 2 8 5 . 7 3 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute Net Charge , Ġ` is `( BigDecimal (" 4 6 4 . 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute V at Charge , Ġ` is `( BigDecimal (" 1 0 6 . 8 6 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute G ross Charge , Ġ` is `( BigDecimal (" 5 7 1 . 4 6 "))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġshould Calculate Bill With O pl ata Hand low a () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġprepare ĊĠĠĠĠĠĠĠ Ġval Ġprices Ġ= ĠT aur on Prices ( ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 L , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 4 . 0 4 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 5 . 0 5 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 6 . 0 6 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 1 2 . 1 2 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 7 . 0 7 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 8 . 0 8 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 9 . 0 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 1 1 . 1 1 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 . 0 0 " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġcalculate ĊĠĠĠĠĠĠĠ Ġval Ġsut Ġ= ĠT aur on G 1 2 Calculated Bill ( ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 5 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 4 5 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocalDate . of ( 2 0 1 5 , ĠMonth . J AN U ARY , Ġ 1 ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocalDate . of ( 2 0 1 5 , ĠMonth . OCT OB ER , Ġ 3 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprices ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġverify ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . day Consumption , Ġ` is `( 1 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . night Consumption , Ġ` is `( 2 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . total Consumption , Ġ` is `( 3 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . month Count , Ġ` is `( 1 0 )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Day Net Charge , Ġ` is `( BigDecimal (" 7 0 . 7 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Day Net Charge , Ġ` is `( BigDecimal (" 9 0 . 9 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Night Net Charge , Ġ` is `( BigDecimal (" 1 6 1 . 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Night Net Charge , Ġ` is `( BigDecimal (" 2 2 2 . 2 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Pr ze j sci owa Net Charge , Ġ` is `( BigDecimal (" 5 0 . 5 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na St ala Net Charge , Ġ` is `( BigDecimal (" 4 0 . 4 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Ab on ament owa Net Charge , Ġ` is `( BigDecimal (" 6 0 . 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Hand low a Net Charge , Ġ` is `( BigDecimal (" 1 2 1 . 2 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Day V at Charge , Ġ` is `( BigDecimal (" 1 6 . 2 6 1 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Day V at Charge , Ġ` is `( BigDecimal (" 2 0 . 9 0 7 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . energ ia Ele k try cz na Night V at Charge , Ġ` is `( BigDecimal (" 3 7 . 1 6 8 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na Z mi enna Night V at Charge , Ġ` is `( BigDecimal (" 5 1 . 1 0 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Pr ze j sci owa V at Charge , Ġ` is `( BigDecimal (" 1 1 . 6 1 5 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Dy stry bu cy j na St ala V at Charge , Ġ` is `( BigDecimal (" 9 . 2 9 2 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Ab on ament owa V at Charge , Ġ` is `( BigDecimal (" 1 3 . 9 3 8 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata Hand low a V at Charge , Ġ` is `( BigDecimal (" 2 7 . 8 7 6 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . net Charge Sum , Ġ` is `( BigDecimal (" 8 1 8 . 1 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . vat Charge Sum , Ġ` is `( BigDecimal (" 1 8 8 . 1 6 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . g ross Charge Sum , Ġ` is `( BigDecimal (" 1 0 0 6 . 2 6 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . exc ise , Ġ` is `( BigDecimal (" 0 . 6 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell Net Charge , Ġ` is `( BigDecimal (" 3 5 3 . 5 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell V at Charge , Ġ` is `( BigDecimal (" 8 1 . 3 1 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell G ross Charge , Ġ` is `( BigDecimal (" 4 3 4 . 8 1 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute Net Charge , Ġ` is `( BigDecimal (" 4 6 4 . 6 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute V at Charge , Ġ` is `( BigDecimal (" 1 0 6 . 8 5 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute G ross Charge , Ġ` is `( BigDecimal (" 5 7 1 . 4 5 "))) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġwhen After July 1 6 Include O pl ata O ze () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġprepare ĊĠĠĠĠĠĠĠ Ġval Ġprices Ġ= ĠT aur on Prices ( ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 L , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 4 . 0 4 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 5 . 0 5 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 6 . 0 6 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 . 0 0 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 7 . 0 7 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 8 . 0 8 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 9 . 0 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 1 1 . 1 1 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 . 0 0 2 5 1 " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġcalculate ĊĠĠĠĠĠĠĠ Ġval Ġsut Ġ= ĠT aur on G 1 2 Calculated Bill ( ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 1 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 5 , ĊĠĠĠĠĠĠĠĠĠĠĠĠ 4 5 , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocalDate . of ( 2 0 1 6 , ĠMonth . J UL Y , Ġ 1 ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠLocalDate . of ( 2 0 1 7 , ĠMonth . AP R IL , Ġ 3 0 ), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprices ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġverify ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . day Consumption From July 1 6 , Ġ` is `( 1 0 )) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . night Consumption From July 1 6 , Ġ` is `( 2 0 )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata O ze Day Net Charge , Ġ` is `( BigDecimal (" 0 . 0 2 5 1 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata O ze Night Net Charge , Ġ` is `( BigDecimal (" 0 . 0 5 0 2 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata O ze Day V at Charge , Ġ` is `( BigDecimal (" 0 . 0 0 5 7 7 3 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . op l ata O ze Night V at Charge , Ġ` is `( BigDecimal (" 0 . 0 1 1 5 4 6 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . net Charge Sum , Ġ` is `( BigDecimal (" 6 9 6 . 9 8 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . vat Charge Sum , Ġ` is `( BigDecimal (" 1 6 0 . 3 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . g ross Charge Sum , Ġ` is `( BigDecimal (" 8 5 7 . 2 8 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . exc ise , Ġ` is `( BigDecimal (" 0 . 6 0 "))) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell Net Charge , Ġ` is `( BigDecimal (" 2 3 2 . 3 0 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell V at Charge , Ġ` is `( BigDecimal (" 5 3 . 4 3 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . sell G ross Charge , Ġ` is `( BigDecimal (" 2 8 5 . 7 3 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute Net Charge , Ġ` is `( BigDecimal (" 4 6 4 . 6 8 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute V at Charge , Ġ` is `( BigDecimal (" 1 0 6 . 8 7 "))) ĊĠĠĠĠĠĠĠ ĠassertThat ( sut . distribute G ross Charge , Ġ` is `( BigDecimal (" 5 7 1 . 5 5 "))) ĊĠĠĠ Ġ} Ċ } Ċ