public HappyPathTest(IpcApplicationFactory <ITestService> factory)
        {
            int port = _rand.Next(10000, 50000);

            _client = factory
                      .WithServiceImplementation(_ => _serviceMock.Object)
                      .WithIpcHostConfiguration(hostBuilder =>
            {
                hostBuilder.AddTcpEndpoint <ITestService>(IPAddress.Loopback, port);
            })
                      .CreateClient((name, services) =>
            {
                services.AddTcpIpcClient <ITestService>(name, IPAddress.Loopback, port);
            });
        }
Beispiel #2
0
        public ContractTest(IpcApplicationFactory <ITestService> factory)
        {
            string pipeName = Guid.NewGuid().ToString();

            _client = factory
                      .WithServiceImplementation(_ => _serviceMock.Object)
                      .WithIpcHostConfiguration(hostBuilder =>
            {
                hostBuilder.AddNamedPipeEndpoint <ITestService>(pipeName);
            })
                      .CreateClient((name, services) =>
            {
                services.AddNamedPipeIpcClient <ITestService>(name, pipeName);
            });
        }
        public SimpleTypeNameContractTest(IpcApplicationFactory <ITestService> factory)
        {
            string pipeName = Guid.NewGuid().ToString();

            _client = factory
                      .WithServiceImplementation(_ => _serviceMock.Object)
                      .WithIpcHostConfiguration(hostBuilder =>
            {
                hostBuilder.AddNamedPipeEndpoint <ITestService>(options =>
                {
                    options.PipeName = pipeName;
                    options.IncludeFailureDetailsInResponse = true;
                });
            })
                      .CreateClient((name, services) =>
            {
                services.AddNamedPipeIpcClient <ITestService>(name, (_, options) =>
                {
                    options.UseSimpleTypeNameAssemblyFormatHandling = true;
                    options.PipeName = pipeName;
                }
                                                              );
            });
        }
Beispiel #4
0
 public StreamTranslatorTest(IpcApplicationFactory <ITestService> factory)
 {
     _factory = factory;
 }
Beispiel #5
0
 public EdgeCaseTest(IpcApplicationFactory <ITestService> factory)
 {
     _factory = factory;
 }
Beispiel #6
0
 public ErrorTest(IpcApplicationFactory <ITestService> factory)
 {
     _factory = factory
                .WithServiceImplementation(_ => _serviceMock.Object);
 }