Making a string logic

Wednesday
2 min readJun 29, 2024

--

Another day another dubloon.

This week I was finally allowed to merge my pull request into the development branche after dealing with the suggestions for improvements by the team. It immediately went live and we could instantly show my endpoint in action at the sprint review later in the week. So I feel somewhat proud.

After finally merging my pull request I picked up a similar PBI (make another endpoint that returns a string that is based on data from the database). This time it would require a lot of complicated logic to create the specific strings. It took me most of a day but I think I got the logic down (learned how to do a .groupBy from LINQ to merge certain data, and then made a large else-if tree to go through the remaining objects to make the strings). As far as I am aware the logic works, even though I do have two very similar pieces of logic that I do not immediately see how to refactor, including an if at the start of the else-if tree and the final else that do not do anything and I am sure I will get comments on those.

Writing the unit tests for these small pieces of logic was also fun and most of my Thursday as I had to hard code the mocked JSON responses from the database. My test class is over 1300 lines big at this point just because of the amount of JSON responses that were needed to get full code coverage. Visual Studio started throwing a fit before I was halfway done but luckily I could continue in VS Code. I am going to have a laugh when I see the coworkers again next week.

--

--

Wednesday
Wednesday

No responses yet