While I am H Pipes in specflow, c# and nunit Framework for testing the pipe connection and passing data using pipes.
The WriteAsync function is called but it's not sending the data to the client application.
Steps to reproduce the bug
create specflow feature file
use the below coding for testing
private PipeServer? _server;
[When(@"Get Sending Data")]
public async Task WhenSendingData()
{
do
{
Task.Run(() => StartServer());
} while (Console.ReadKey(true).Key != ConsoleKey.Escape);
}
public async Task StartServer()
{
while (!_token.IsCancellationRequested && _server is not { IsStarted: true })
{
try
{
_server = new PipeServer<string>("TestPipe");
_server.ClientConnected += OnClientConnected;
await _server.StartAsync(_token.Token);
}
catch (Exception ex)
{
Console.WriteLine("Failed to start server");
}
}
}
public void OnClientConnected(object? sender, ConnectionEventArgs e)
{
Console.WriteLine($"Client has connected to {e.Connection.PipeName}");
Console.WriteLine($"Client has connected to {e.Connection}");
e.Connection.WriteAsync("Welcome!");
}
Run the test
There is no bug but it's not communicating. If i close the c++ execution, it's giving me pipe closed error. The id for Pipe is also created
Describe the bug
While I am H Pipes in specflow, c# and nunit Framework for testing the pipe connection and passing data using pipes.
The WriteAsync function is called but it's not sending the data to the client application.
Steps to reproduce the bug
private PipeServer? _server;
[When(@"Get Sending Data")] public async Task WhenSendingData() {
}
public async Task StartServer() {
}
public void OnClientConnected(object? sender, ConnectionEventArgs e)
{
Console.WriteLine($"Client has connected to {e.Connection.PipeName}");
Console.WriteLine($"Client has connected to {e.Connection}");
}
There is no bug but it's not communicating. If i close the c++ execution, it's giving me pipe closed error. The id for Pipe is also created
Test.SignalPipe_ba006207-cdaf-4365-99b8-a06258d3c65e
Please not the same is working well in console application where I could send message but not working in specflow testing application.
Expected behavior
No response
Screenshots
No response
NuGet package version
Platform
Console
IDE
Visual Studio 2022
Additional context
No response