commit bb5636cc64c824249cd55140f4d05f6776386fbd
Author: Jan Jirman <fajirmja@seznam.cz>
Date:   Fri May 24 22:31:19 2019 +0200

    Testování třídy Bitmap (Re #7489)

diff --git a/src/test/testBitmap.java b/src/test/testBitmap.java
index 7ffab1f..81f97af 100644
--- a/src/test/testBitmap.java
+++ b/src/test/testBitmap.java
@@ -2,6 +2,7 @@ package test;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 import java.time.DayOfWeek;
 import java.time.LocalDate;
@@ -25,12 +26,15 @@ public class testBitmap {
     private static Bitmap bitmap;
     private static LocalDate dateFrom;
     private static LocalDate dateTo;
+    private char[] hardCodesChar;
 
     @BeforeClass
     public static void setUpBeforeClass() {
 
         BasicConfigurator.configure();
         Logger.getRootLogger().setLevel(Level.INFO);
+        
+        
     
     }
     
@@ -39,8 +43,11 @@ public class testBitmap {
 
         dateFrom = LocalDate.of(2019, 5, 1);
         dateTo = LocalDate.of(2019, 5, 31);
+        
+       
 
         bitmap = new Bitmap(dateFrom, dateTo, "143440","1","34", "5", "1");
+        hardCodesChar = bitmap.getHardCodes().toCharArray();
     
     }
 
@@ -74,12 +81,24 @@ public class testBitmap {
     	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]"));
     }
     
+    @Test
+    public void testsetWorkdaysInRange(){
+    	bitmap.setWorkdaysInRange(LocalDate.of(2019, 5, 1), LocalDate.of(2019, 5, 15), 1);
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
+    } 
+    
     @Test
     public void testsetSundaysAndHolidays() {
     	bitmap.setSundaysAndHolidays(1);
     	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1]"));
     }
     
+    @Test
+    public void testsetSundaysAndHolidays2() {
+    	bitmap.setSundaysAndHolidays(LocalDate.of(2019, 5, 1), LocalDate.of(2019, 5, 15),1);
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
+    }
+    
     
     @Test
     public void testsetOneDayOnly() {
@@ -98,6 +117,13 @@ public class testBitmap {
     	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
     }
     
+    @Test
+    public void unsetDaysInRange() {
+    	bitmap.setWorkdays(1);
+          bitmap.unsetDaysInRange(LocalDate.of(2019, 5, 1), LocalDate.of(2019, 5, 15));
+          assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1]"));
+    }
+    
     @Test
     public void testsetDaysInWeek(){
     	bitmap.setDaysInWeek(DayOfWeek.MONDAY, 1); //kazde pondeli ... pondeli - 2
@@ -105,6 +131,12 @@ public class testBitmap {
     	
     }
     
+    @Test
+    public void testsetDaysInWeek2(){
+    	bitmap.setDaysInWeek(LocalDate.of(2019, 5, 1), LocalDate.of(2019, 5, 15),DayOfWeek.MONDAY, 1); //kazde pondeli ... pondeli - 2
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
+    }
+    
     @Test
     public void testsetWeeks(){
     	bitmap.setWeeks(1, 1);
@@ -121,6 +153,57 @@ public class testBitmap {
     
     }
     
+    @Test
+    public void setHolidays() {
+    	bitmap.setHolidays(1);
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
+    }
+    
+    @Test
+    public void setHardCodeDays() {
+    	bitmap.setHardCodeDays(LocalDate.of(2019, 5, 1), LocalDate.of(2019, 5, 15), 1); 
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
+        
+    }
+  
+    
+    @Test
+    public void setHardCodeWeeks() {
+    	bitmap.setHardCodeWeeks(1,1); 
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]"));
+      
+    }
+    
+    
+    @Test
+    public void setHardCodeWeeksInRange() {
+    	bitmap.setHardCodeWeeksInRange(LocalDate.of(2019, 5, 1), LocalDate.of(2019, 5, 15),1,1); 
+    	assertEquals(0,bitmap.bitmapToString().compareToIgnoreCase("[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]"));
+      
+    }
+    
+    @Test
+    public void testisHardCodeDay(){
+    	assertTrue(bitmap.isHardCodeDay(LocalDate.of(2019, 5, 10), hardCodesChar[0]));
+    }
+    
+    @Test
+    public void isBankHoliday() {
+    	assertTrue(bitmap.isBankHoliday(LocalDate.of(2019, 5, 1)));
+    }
+    
+    /* @Test
+    public void getEasterHolidays() {
+    	bitmap.getEasterHolidays(2019);
+    	bitmap.;
+    } */
+    
+    @Test
+    public void getBitmapString() {
+    	bitmap.setWorkdays(1);
+    	assertEquals(0,bitmap.getBitmapString().compareToIgnoreCase("0110011011001111100111110011111"));
+    }
+    
     @Test
     public void testfillWithZeros(){
     	bitmap.fillWithZeros();
