How to test this code? - C#