dzhw / zofar

10 stars 1 forks source link

calendar: automated testing for zofar functions #488

Closed andreaschu closed 2 years ago

andreaschu commented 2 years ago

As a developer I need an automated testing strategy for zofar functions to find bugs later more easily.

We need:

christian-fr commented 2 years ago

list of zofar functions:

implemented test case inputJsonString01/inputJsonArray01 :

[
   {
      "id":0,
      "name":"123",
      "type":"Slot1",
      "typeColor":"blue",
      "startDate":"2018-01-01T01:00:00.000Z",
      "endDate":"2020-04-30T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"blue"
   },
   {
      "id":1,
      "name":"123",
      "type":"Slot5",
      "typeColor":"brown",
      "startDate":"2019-03-01T01:00:00.000Z",
      "endDate":"2021-03-31T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"brown"
   },
   {
      "id":2,
      "name":"Arbeiten",
      "type":"Slot2",
      "typeColor":"red",
      "startDate":"2019-03-01T01:00:00.000Z",
      "endDate":"2022-12-31T01:00:00.000Z",
      "state":"new",
      "slot":2,
      "color":"red"
   },
   {
      "id":3,
      "name":"sonstwas",
      "type":"Slot6",
      "typeColor":"yellow",
      "startDate":"2021-03-01T01:00:00.000Z",
      "endDate":"2024-03-31T01:00:00.000Z",
      "state":"new",
      "slot":0
   }
]

implemented test case inputJsonString02/inputJsonArray02:

Test_Modul Screenshot: **inputJsonArray02**

[
   {
      "id":0,
      "name":"",
      "type":"Slot1",
      "typeColor":"blue",
      "startDate":"2019-01-01T01:00:00.000Z",
      "endDate":"2019-05-20T01:00:00.000Z",
      "state":"updated",
      "slot":0,
      "color":"blue"
   },
   {
      "id":1,
      "name":"hier und da",
      "type":"Slot4",
      "typeColor":"orange",
      "startDate":"2021-02-01T01:00:00.000Z",
      "endDate":"2021-09-20T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"orange"
   },
   {
      "id":2,
      "name":"Arbeiten",
      "type":"Slot5",
      "typeColor":"brown",
      "startDate":"2022-01-01T01:00:00.000Z",
      "endDate":"2022-06-20T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"brown"
   },
   {
      "id":3,
      "name":"erwerbslos",
      "type":"Slot8",
      "typeColor":"lightgreen",
      "startDate":"2020-02-01T01:00:00.000Z",
      "endDate":"2020-11-20T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"lightgreen"
   },
   {
      "id":4,
      "name":"work and travel",
      "type":"Slot9",
      "typeColor":"lightblue",
      "startDate":"2023-08-01T01:00:00.000Z",
      "endDate":"2024-12-20T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"lightblue"
   },
   {
      "id":5,
      "name":"Elternzeit wegen Michaela",
      "type":"Slot7",
      "typeColor":"lightgray",
      "startDate":"2018-01-01T01:00:00.000Z",
      "endDate":"2018-12-20T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"lightgray"
   },
   {
      "id":6,
      "name":"Elternzeit wegen Konstantin",
      "type":"Slot7",
      "typeColor":"lightgray",
      "startDate":"2022-07-01T01:00:00.000Z",
      "endDate":"2023-07-20T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"lightgray"
   },
   {
      "id":7,
      "name":"Weiterbildung zum Fachwirt",
      "type":"Slot3",
      "typeColor":"grey",
      "startDate":"2021-10-01T01:00:00.000Z",
      "endDate":"2021-12-20T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"grey"
   },
   {
      "id":8,
      "name":"Pause",
      "type":"Slot8",
      "typeColor":"lightgreen",
      "startDate":"2020-12-01T01:00:00.000Z",
      "endDate":"2021-01-20T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"lightgreen"
   },
   {
      "id":9,
      "name":"Volontariat bei der FAZ",
      "type":"Slot2",
      "typeColor":"red",
      "startDate":"2019-06-01T01:00:00.000Z",
      "endDate":"2020-01-20T01:00:00.000Z",
      "state":"new",
      "slot":1
   }
]

implemented test case inputJsonString03/inputJsonArray03:

Test_Modul Screenshot: grafik

[
   {
      "id":0,
      "name":"",
      "type":"Slot1",
      "typeColor":"blue",
      "startDate":"2019-01-01T01:00:00.000Z",
      "endDate":"2019-05-31T01:00:00.000Z",
      "state":"updated",
      "slot":0,
      "color":"blue"
   },
   {
      "id":1,
      "name":"hier und da",
      "type":"Slot4",
      "typeColor":"orange",
      "startDate":"2021-02-01T01:00:00.000Z",
      "endDate":"2021-09-30T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"orange"
   },
   {
      "id":2,
      "name":"Arbeiten",
      "type":"Slot5",
      "typeColor":"brown",
      "startDate":"2022-01-01T01:00:00.000Z",
      "endDate":"2022-06-30T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"brown"
   },
   {
      "id":3,
      "name":"erwerbslos",
      "type":"Slot8",
      "typeColor":"lightgreen",
      "startDate":"2020-02-01T01:00:00.000Z",
      "endDate":"2020-11-30T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"lightgreen"
   },
   {
      "id":4,
      "name":"work and travel",
      "type":"Slot9",
      "typeColor":"lightblue",
      "startDate":"2023-08-01T01:00:00.000Z",
      "endDate":"2024-12-31T01:00:00.000Z",
      "state":"new",
      "slot":0,
      "color":"lightblue"
   },
   {
      "id":5,
      "name":"Elternzeit wegen Michaela",
      "type":"Slot7",
      "typeColor":"lightgray",
      "startDate":"2018-01-01T01:00:00.000Z",
      "endDate":"2018-12-31T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"lightgray"
   },
   {
      "id":7,
      "name":"Weiterbildung zum Fachwirt",
      "type":"Slot3",
      "typeColor":"grey",
      "startDate":"2021-10-01T01:00:00.000Z",
      "endDate":"2021-12-31T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"grey"
   },
   {
      "id":8,
      "name":"Pause",
      "type":"Slot8",
      "typeColor":"lightgreen",
      "startDate":"2020-12-01T01:00:00.000Z",
      "endDate":"2021-01-31T01:00:00.000Z",
      "state":"new",
      "slot":1,
      "color":"lightgreen"
   }
]

jUnit-Tests are implemented for both functions.

christian-fr commented 2 years ago

Maven goal test successfully implemented.

Unit tests are run everytime the presentation.surveyEngine is being built.

We have implemented unit tests for the zofar functions delJson and countEpisodesRatio.

grafik