@@ -276,181 +276,181 @@ class WCCustomerMapperTest {
276276
277277 @Test
278278 fun `given customer name, then first name is properly assigned` () {
279- // given
279+ // GIVEN
280280 val siteId = 23
281281 val site = SiteModel ().apply { id = siteId }
282282
283283 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname lastname" )
284284
285- // when
285+ // WHEN
286286 val result = mapper.mapToModel(site, customerDTO)
287287
288- // then
288+ // THEN
289289 assertEquals(" firstname" , result.firstName)
290290 }
291291
292292 @Test
293293 fun `given customer name as null, then first name returns empty string` () {
294- // given
294+ // GIVEN
295295 val siteId = 23
296296 val site = SiteModel ().apply { id = siteId }
297297
298298 val customerDTO = CustomerFromAnalyticsDTO (name = null )
299299
300- // when
300+ // WHEN
301301 val result = mapper.mapToModel(site, customerDTO)
302302
303- // then
303+ // THEN
304304 assertEquals(" " , result.firstName)
305305 }
306306
307307 @Test
308308 fun `given customer name with no space, then first name returns full string` () {
309- // given
309+ // GIVEN
310310 val siteId = 23
311311 val site = SiteModel ().apply { id = siteId }
312312
313313 val customerDTO = CustomerFromAnalyticsDTO (name = " firstnamelastname" )
314314
315- // when
315+ // WHEN
316316 val result = mapper.mapToModel(site, customerDTO)
317317
318- // then
318+ // THEN
319319 assertEquals(" firstnamelastname" , result.firstName)
320320 }
321321
322322 @Test
323323 fun `given customer name, then last name is properly assigned` () {
324- // given
324+ // GIVEN
325325 val siteId = 23
326326 val site = SiteModel ().apply { id = siteId }
327327
328328 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname lastname" )
329329
330- // when
330+ // WHEN
331331 val result = mapper.mapToModel(site, customerDTO)
332332
333- // then
333+ // THEN
334334 assertEquals(" lastname" , result.lastName)
335335 }
336336
337337 @Test
338338 fun `given customer name as null, then last name returns empty string` () {
339- // given
339+ // GIVEN
340340 val siteId = 23
341341 val site = SiteModel ().apply { id = siteId }
342342
343343 val customerDTO = CustomerFromAnalyticsDTO (name = null )
344344
345- // when
345+ // WHEN
346346 val result = mapper.mapToModel(site, customerDTO)
347347
348- // then
348+ // THEN
349349 assertEquals(" " , result.lastName)
350350 }
351351
352352 @Test
353353 fun `given customer name has no space, then last name returns empty string` () {
354- // given
354+ // GIVEN
355355 val siteId = 23
356356 val site = SiteModel ().apply { id = siteId }
357357
358358 val customerDTO = CustomerFromAnalyticsDTO (name = " firstnamelastname" )
359359
360- // when
360+ // WHEN
361361 val result = mapper.mapToModel(site, customerDTO)
362362
363- // then
363+ // THEN
364364 assertEquals(" " , result.lastName)
365365 }
366366
367367 @Test
368368 fun `given customer name has multiple spaces, then first name returns proper string` () {
369- // given
369+ // GIVEN
370370 val siteId = 23
371371 val site = SiteModel ().apply { id = siteId }
372372
373373 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname and a very long last name" )
374374
375- // when
375+ // WHEN
376376 val result = mapper.mapToModel(site, customerDTO)
377377
378- // then
378+ // THEN
379379 assertEquals(" firstname" , result.firstName)
380380 }
381381
382382 @Test
383383 fun `given customer name has multiple spaces, then last name returns proper string` () {
384- // given
384+ // GIVEN
385385 val siteId = 23
386386 val site = SiteModel ().apply { id = siteId }
387387
388388 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname and a very long last name" )
389389
390- // when
390+ // WHEN
391391 val result = mapper.mapToModel(site, customerDTO)
392392
393- // then
393+ // THEN
394394 assertEquals(" and a very long last name" , result.lastName)
395395 }
396396
397397 @Test
398398 fun `given customer name has leading space, then first name returns proper string` () {
399- // given
399+ // GIVEN
400400 val siteId = 23
401401 val site = SiteModel ().apply { id = siteId }
402402
403403 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname and a very long last name" )
404404
405- // when
405+ // WHEN
406406 val result = mapper.mapToModel(site, customerDTO)
407407
408- // then
408+ // THEN
409409 assertEquals(" firstname" , result.firstName)
410410 }
411411
412412 @Test
413413 fun `given customer name has trailing space, then last name returns proper string` () {
414- // given
414+ // GIVEN
415415 val siteId = 23
416416 val site = SiteModel ().apply { id = siteId }
417417
418418 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname and a very long last name " )
419419
420- // when
420+ // WHEN
421421 val result = mapper.mapToModel(site, customerDTO)
422422
423- // then
423+ // THEN
424424 assertEquals(" and a very long last name" , result.lastName)
425425 }
426426
427427 @Test
428428 fun `given customer name has multiple in between space, then first name returns proper string` () {
429- // given
429+ // GIVEN
430430 val siteId = 23
431431 val site = SiteModel ().apply { id = siteId }
432432
433433 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname and a very long last name" )
434434
435- // when
435+ // WHEN
436436 val result = mapper.mapToModel(site, customerDTO)
437437
438- // then
438+ // THEN
439439 assertEquals(" firstname" , result.firstName)
440440 }
441441
442442 @Test
443443 fun `given customer name has multiple in between space, then last name returns proper string` () {
444- // given
444+ // GIVEN
445445 val siteId = 23
446446 val site = SiteModel ().apply { id = siteId }
447447
448448 val customerDTO = CustomerFromAnalyticsDTO (name = " firstname and a very long last name" )
449449
450- // when
450+ // WHEN
451451 val result = mapper.mapToModel(site, customerDTO)
452452
453- // then
453+ // THEN
454454 assertEquals(" and a very long last name" , result.lastName)
455455 }
456456}
0 commit comments