@@ -63,6 +63,7 @@ describe('String.Format', () => {
6363
6464 let expectedValue = "13.04.2017" ;
6565 let result = String . Format ( template , valueToInsert ) ;
66+ console . log ( result ) ;
6667 expect ( result ) . to . equal ( expectedValue ) ;
6768 } ) ;
6869
@@ -72,6 +73,7 @@ describe('String.Format', () => {
7273
7374 let expectedValue = "2017-04-13" ;
7475 let result = String . Format ( template , valueToInsert ) ;
76+ console . log ( result ) ;
7577 expect ( result ) . to . equal ( expectedValue ) ;
7678 } ) ;
7779
@@ -81,6 +83,7 @@ describe('String.Format', () => {
8183
8284 let expectedValue = "23.01.2017" ;
8385 let result = String . Format ( template , valueToInsert ) ;
86+ console . log ( result ) ;
8487 expect ( result ) . to . equal ( expectedValue ) ;
8588 } ) ;
8689
@@ -90,6 +93,17 @@ describe('String.Format', () => {
9093
9194 let expectedValue = "2017-03-21T22:15:01" ;
9295 let result = String . Format ( template , valueToInsert ) ;
96+ console . log ( result ) ;
97+ expect ( result ) . to . equal ( expectedValue ) ;
98+ } ) ;
99+
100+ it ( 'should set the correct sortable date without time using string' , ( ) => {
101+ let template = "{0:s}" ;
102+ let valueToInsert = '21.03.2017' ;
103+
104+ let expectedValue = "2017-03-21T00:00:00" ;
105+ let result = String . Format ( template , valueToInsert ) ;
106+ console . log ( result ) ;
93107 expect ( result ) . to . equal ( expectedValue ) ;
94108 } ) ;
95109 } ) ;
@@ -123,7 +137,7 @@ describe('String.Format', () => {
123137 let result = String . Format ( template , 5 ) ;
124138 expect ( result ) . to . equal ( '5' ) ;
125139 } ) ;
126-
140+
127141 it ( 'should pad 5 to 05 using {0:00}' , ( ) => {
128142 let template = '{0:00}' ;
129143 let result = String . Format ( template , 5 ) ;
@@ -136,6 +150,12 @@ describe('String.Format', () => {
136150 expect ( result ) . to . equal ( '005' ) ;
137151 } ) ;
138152
153+ it ( 'should ignore padding when input is longer then template' , ( ) => {
154+ let template = '{0:000}' ;
155+ let result = String . Format ( template , 50000 ) ;
156+ expect ( result ) . to . equal ( '50000' ) ;
157+ } ) ;
158+
139159 it ( 'should set the correct thousands seperator' , ( ) => {
140160 let template = '{0:n}' ;
141161 let valueToInsert = '10000000000' ;
@@ -176,9 +196,9 @@ describe('String.Join', () => {
176196
177197 it ( 'should join the given object' , ( ) => {
178198 let object = { Name : "Foo" , Value : "Bar" } ;
179-
180199 let result = String . Join ( '.' , object ) ;
181200
201+ console . log ( result ) ;
182202 expect ( result ) . to . equal ( "Foo.Bar" ) ;
183203 } ) ;
184204} ) ;
0 commit comments