616b2f / dotnet-bsp

Implementation of the BSP (Build Server Protocol) for dotnet C#
MIT License
6 stars 0 forks source link

Unittest for dotnet-bsp #1

Open schinnerld opened 1 month ago

schinnerld commented 1 month ago

Hi Alexej! I need to understand BSP and your (great) implementation of it. That is the reason why I am in the process of writing unittests for it. For a better debugging experience, client and server run in the same process space in unittests. Small changes to your code were necessary for that. I am using the named pipes implementation and need to pass the pipe name of from outside. Single unittest looks like this then.

 [TestMethod]
 public async Task BuildInitialize_Compile_CSharp_Async()
 {
     var result = await _testClient?.BuildInitializeAsync()!;
     Assert.AreEqual("csharp", result.Capabilities.CompileProvider?.LanguageIds.FirstOrDefault());
 }

If you want it like this in your project, I will create a PR for it.

Thank you! Best regards, Dietmar

616b2f commented 1 month ago

Hi Dietmar,

I would be happy to accept such an PR. I didn't manage to create tests yet due to lack of time, but they are definitely planned and needed.

I would prefer XUnit tests, but if you are not familiar with it I would also accept any other framework and would rewrite it when I implement the rest of the tests.