@@ -89,7 +89,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
8989
9090 public test_WhenCreated_MonthIsCurrentMonth ( ) {
9191 const actualValue = this . testView . month ;
92- const expectedValue = currentDate . getMonth ( ) ;
92+ const expectedValue = currentDate . getMonth ( ) + 1 ;
9393 TKUnit . assertEqual ( actualValue , expectedValue ) ;
9494 }
9595
@@ -99,11 +99,6 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
9999 TKUnit . assertEqual ( actualValue , expectedValue ) ;
100100 }
101101
102- public test_WhenCreated_DateIsCurrentDate ( ) {
103- const expectedValue = currentDate ;
104- assertDate ( this . testView , expectedValue . getFullYear ( ) , expectedValue . getMonth ( ) , expectedValue . getDate ( ) ) ;
105- }
106-
107102 public testYearFromLocalToNative ( ) {
108103 const expectedValue = 1980 ;
109104 this . testView . year = expectedValue ;
@@ -129,11 +124,10 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
129124 const today = new Date ( 2016 , 3 , 15 ) ;
130125 this . testView . year = today . getFullYear ( ) ;
131126 this . testView . month = today . getMonth ( ) ;
132-
133127 const expectedValue = today . getDate ( ) ;
134128 this . testView . day = expectedValue ;
135129
136- const expectedDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) , expectedValue ) ;
130+ const expectedDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) - 1 , expectedValue ) ;
137131 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
138132 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
139133 TKUnit . assertEqual ( this . testView . date . getFullYear ( ) , expectedDate . getFullYear ( ) , "Getting Year from date property failed." ) ;
@@ -146,7 +140,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
146140
147141 const expectedValue = today . getMonth ( ) ;
148142 this . testView . month = expectedValue ;
149- const expectedDate = new Date ( today . getFullYear ( ) , expectedValue , today . getDate ( ) ) ;
143+ const expectedDate = new Date ( today . getFullYear ( ) , expectedValue - 1 , today . getDate ( ) ) ;
150144
151145 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
152146 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
@@ -160,7 +154,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
160154
161155 const expectedValue = 1980 ;
162156 this . testView . year = expectedValue ;
163- const expectedDate = new Date ( 1980 , current . getMonth ( ) , current . getDate ( ) ) ;
157+ const expectedDate = new Date ( 1980 , current . getMonth ( ) - 1 , current . getDate ( ) ) ;
164158
165159 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
166160 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
@@ -218,7 +212,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
218212
219213 datePickerTestsNative . setNativeDate ( this . testView , today . getFullYear ( ) , today . getMonth ( ) , expectedValue ) ;
220214
221- const expectedDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) , expectedValue ) ;
215+ const expectedDate = new Date ( today . getFullYear ( ) , today . getMonth ( ) - 1 , expectedValue ) ;
222216 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
223217 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
224218 TKUnit . assertEqual ( this . testView . date . getFullYear ( ) , expectedDate . getFullYear ( ) , "Getting Year from date property failed." ) ;
@@ -230,7 +224,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
230224
231225 datePickerTestsNative . setNativeDate ( this . testView , today . getFullYear ( ) , expectedValue , today . getDate ( ) ) ;
232226
233- const expectedDate = new Date ( today . getFullYear ( ) , expectedValue , today . getDate ( ) ) ;
227+ const expectedDate = new Date ( today . getFullYear ( ) , expectedValue - 1 , today . getDate ( ) ) ;
234228 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
235229 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
236230 TKUnit . assertEqual ( this . testView . date . getFullYear ( ) , expectedDate . getFullYear ( ) , "Getting Year from date property failed." ) ;
@@ -242,7 +236,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
242236 const expectedValue = 1981 ;
243237 datePickerTestsNative . setNativeDate ( this . testView , expectedValue , today . getMonth ( ) , today . getDate ( ) ) ;
244238
245- const expectedDate = new Date ( expectedValue , today . getMonth ( ) , today . getDate ( ) ) ;
239+ const expectedDate = new Date ( expectedValue , today . getMonth ( ) - 1 , today . getDate ( ) ) ;
246240 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
247241 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
248242 TKUnit . assertEqual ( this . testView . date . getFullYear ( ) , expectedDate . getFullYear ( ) , "Getting Year from date property failed." ) ;
@@ -254,7 +248,7 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
254248 const testDay = 24 ;
255249
256250 datePickerTestsNative . setNativeDate ( this . testView , testYear , testMonth , testDay ) ;
257- const expectedDate = new Date ( testYear , testMonth , testDay ) ;
251+ const expectedDate = new Date ( testYear , testMonth - 1 , testDay ) ;
258252 TKUnit . assertEqual ( this . testView . date . getDate ( ) , expectedDate . getDate ( ) , "Getting Day from date property failed." ) ;
259253 TKUnit . assertEqual ( this . testView . date . getMonth ( ) , expectedDate . getMonth ( ) , "Getting Month from date property failed." ) ;
260254 TKUnit . assertEqual ( this . testView . date . getFullYear ( ) , expectedDate . getFullYear ( ) , "Getting Year from date property failed." ) ;
0 commit comments