public EndpointTests() { _computingCallback = new ComputingCallback { Id = Guid.NewGuid().ToString() }; _systemCallback = new SystemCallback { Id = Guid.NewGuid().ToString() }; _serviceProvider = IpcHelpers.ConfigureServices(); _computingService = (ComputingService)_serviceProvider.GetService <IComputingService>(); _systemService = (SystemService)_serviceProvider.GetService <ISystemService>(); _host = new ServiceHostBuilder(_serviceProvider) .UseNamedPipes(new NamedPipeSettings(PipeName) { RequestTimeout = RequestTimeout }) .AddEndpoint <IComputingServiceBase>() .AddEndpoint <IComputingService, IComputingCallback>() .AddEndpoint <ISystemService, ISystemCallback>() .ValidateAndBuild(); _host.RunAsync(); _computingClient = ComputingClientBuilder().ValidateAndBuild(); _systemClient = CreateSystemService(); }
public void TheCallbackContractMustBeAnInterface() => new Action(() => new NamedPipeClientBuilder <ISystemService, ValidationTests>("", IpcHelpers.ConfigureServices()).ValidateAndBuild()).ShouldThrow <ArgumentOutOfRangeException>().Message.ShouldStartWith("The contract must be an interface!");
public void TheServiceContractMustBeAnInterface() => new Action(() => new ServiceHostBuilder(IpcHelpers.ConfigureServices()).AddEndpoint <ValidationTests>().ValidateAndBuild()).ShouldThrow <ArgumentOutOfRangeException>().Message.ShouldStartWith("The contract must be an interface!");
public TestBase() { _guiThread.SynchronizationContext.Send(() => Thread.CurrentThread.Name = "GuiThread"); _serviceProvider = IpcHelpers.ConfigureServices(); }