✅ How to write unit test for this? - C#