Exemplo n.º 1
0
 public async Task Should_Return_Configuration_Settings()
 {
     var pipeServer = new PipeServer <IClientCommunication, IServerCommunication>(new NullLoggerFactory());
     var pipeName   = Guid.NewGuid().ToString();
     var mocked     = new Mock <IServerCommunication>();
     var task       = Task.Run(async() =>
     {
         await pipeServer.WaitForConnectionAsync(pipeName, () => mocked.Object, CancellationToken.None);
         Assert.Equal("TestValue", await pipeServer.InvokeAsync(x => x.GetConfiguration("TestKey")));
         Assert.Equal("loadit", await pipeServer.InvokeAsync(x => x.GetConfigurationSection("InfluxDB", "Database")));
     });
     var taskRun = Execute <PipeTest>("--pipe", pipeName, "--out", "pipe");
     await Task.WhenAll(task, taskRun);
 }