[csharp] small refactoring in tests