Example #1
0
        static DelegateServiceFactory GetDelegateServiceFactory()
        {
            var services = new DelegateServiceFactory();

            services.Register <IEchoService>(() => new EchoService());
            return(services);
        }
Example #2
0
        const string SslCertificateThumbprint = "6E5C6492129B75A4C83E1A23797AF6344092E5C2"; // For WebSockets. This is different to the internally configured thumbprint
        public static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.ColoredConsole()
                         .MinimumLevel.Warning()
                         .CreateLogger();

            Console.Title = "Halibut Server";
            var certificate = new X509Certificate2("HalibutServer.pfx");

            var endPoint = new IPEndPoint(IPAddress.IPv6Any, 8433);

            var services = new DelegateServiceFactory();

            services.Register <ICalculatorService>(() => new CalculatorService());

            using (var server = new HalibutRuntime(services, certificate))
            {
                //Although this is the "Server" because it is the thing handling a request
                //in Octopus terms, this would be the Tentacle, being asked to do some work

                //Begin Listening Setup
                //server.Listen(endPoint);
                //server.Trust("2074529C99D93D5955FEECA859AEAC6092741205");
                //End Listening Setup

                //Begin Polling Setup
                //server.Poll(new Uri("poll://SQ-TENTAPOLL"), new ServiceEndPoint(new Uri("https://localhost:8433"), "2074529C99D93D5955FEECA859AEAC6092741205"));
                //End Polling Setup

                //Begin WebSocket Polling Setup

                server.Poll(new Uri("poll://SQ-TENTAPOLL"), new ServiceEndPoint(new Uri("wss://localhost:8433/Halibut"), SslCertificateThumbprint));
                //End WebSocket Polling Setup

                Console.WriteLine("Server listening on port 8433. Type 'exit' to quit, or 'cls' to clear...");
                while (true)
                {
                    var line = Console.ReadLine();
                    if (string.Equals("cls", line, StringComparison.OrdinalIgnoreCase))
                    {
                        Console.Clear();
                        continue;
                    }

                    if (string.Equals("q", line, StringComparison.OrdinalIgnoreCase))
                    {
                        return;
                    }

                    if (string.Equals("exit", line, StringComparison.OrdinalIgnoreCase))
                    {
                        return;
                    }

                    Console.WriteLine("Unknown command. Enter 'q' to quit.");
                }
            }
        }
Example #3
0
        static int RunServer()
        {
            var services = new DelegateServiceFactory();
            services.Register<ICalculatorService>(() => new CalculatorService());

            var server = new HalibutRuntime(services, ServerCertificate);
            server.Trust("2074529C99D93D5955FEECA859AEAC6092741205");
            var port = server.Listen();
            return port;
        }
Example #4
0
        public void StartServer()
        {
            var services = new DelegateServiceFactory();

            services.Register <ITestService>(() => new TestService());
            var DaServer = new HalibutRuntime(services, Configuration.ServerCertificate);

            DaServer.Listen(1337);
            DaServer.Trust(Configuration.ClientCertificate.Thumbprint);
        }
Example #5
0
        public TentacleForm()
        {
            InitializeComponent();

            log = new Logger(textBox1);

            var tentacleServices = new DelegateServiceFactory();
            tentacleServices.Register<IHealthCheckService>(() => new HealthCheck(log));

            tentacleHalibutRuntime = new HalibutRuntime(tentacleServices, new X509Certificate2("OctopusTentacle.pfx"));
        }
 public void SetUp()
 {
     var services = new DelegateServiceFactory();
     services.Register<IEchoService>(() => new EchoService());
     tentacle = new HalibutRuntime(services, Certificates.TentacleListening);
     var tentaclePort = tentacle.Listen();
     tentacle.Trust(Certificates.OctopusPublicThumbprint);
     endpoint = new ServiceEndPoint("https://localhost:" + tentaclePort, Certificates.TentacleListeningPublicThumbprint);
     log = new InMemoryConnectionLog(endpoint.ToString());
     HalibutLimits.ConnectionErrorRetryTimeout = TimeSpan.MaxValue;
 }
Example #7
0
        public TentacleForm()
        {
            InitializeComponent();

            log = new Logger(textBox1);

            var tentacleServices = new DelegateServiceFactory();

            tentacleServices.Register <IHealthCheckService>(() => new HealthCheck(log));

            tentacleHalibutRuntime = new HalibutRuntime(tentacleServices, new X509Certificate2("OctopusTentacle.pfx"));
        }
        public SecureClientFixture()
        {
            var services = new DelegateServiceFactory();

            services.Register <IEchoService>(() => new EchoService());
            tentacle = new HalibutRuntime(services, Certificates.TentacleListening);
            var tentaclePort = tentacle.Listen();

            tentacle.Trust(Certificates.OctopusPublicThumbprint);
            endpoint = new ServiceEndPoint("https://localhost:" + tentaclePort, Certificates.TentacleListeningPublicThumbprint);
            log      = new InMemoryConnectionLog(endpoint.ToString());
            HalibutLimits.ConnectionErrorRetryTimeout = TimeSpan.MaxValue;
        }
Example #9
0
        static int RunServer()
        {
            var services = new DelegateServiceFactory();

            services.Register <ICalculatorService>(() => new CalculatorService());

            var server = new HalibutRuntime(services, ServerCertificate);

            server.Trust("2074529C99D93D5955FEECA859AEAC6092741205");
            var port = server.Listen();

            return(port);
        }
Example #10
0
        public void SetUp()
        {
            var services = new DelegateServiceFactory();

            services.Register <IEchoService>(() => new EchoService());
            tentacle = new HalibutRuntime(services, Certificates.TentacleListening);
            var tentaclePort = tentacle.Listen();

            tentacle.Trust(Certificates.OctopusPublicThumbprint);
            endpoint = new ServiceEndPoint("https://localhost:" + tentaclePort, Certificates.TentacleListeningPublicThumbprint)
            {
                ConnectionErrorRetryTimeout = TimeSpan.MaxValue
            };
        }
Example #11
0
        static HalibutRuntime RunServer(X509Certificate2 serverCertificate, out int port)
        {
            var services = new DelegateServiceFactory();

            services.Register <ICalculatorService>(() => new CalculatorService());

            var server = new HalibutRuntime(services, serverCertificate);

            //set up listening
            server.Trust(Certificates.TentacleListeningPublicThumbprint);
            port = server.Listen();

            //setup polling websocket
            AddSslCertToLocalStoreAndRegisterFor("0.0.0.0:8434");

            return(server);
        }
Example #12
0
        public static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.ColoredConsole()
                         .CreateLogger();

            Console.Title = "Halibut Server";
            var certificate = new X509Certificate2("HalibutServer.pfx");

            var endPoint = new IPEndPoint(IPAddress.IPv6Any, 8433);

            var services = new DelegateServiceFactory();

            services.Register <ICalculatorService>(() => new CalculatorService());

            using (var server = new HalibutRuntime(services, certificate))
            {
                server.Listen(endPoint);
                server.Trust("2074529C99D93D5955FEECA859AEAC6092741205");

                Console.WriteLine("Server listening on port 8433. Type 'exit' to quit, or 'cls' to clear...");

                while (true)
                {
                    var line = Console.ReadLine();
                    if (string.Equals("cls", line, StringComparison.OrdinalIgnoreCase))
                    {
                        Console.Clear();
                        continue;
                    }

                    if (string.Equals("q", line, StringComparison.OrdinalIgnoreCase))
                    {
                        return;
                    }

                    if (string.Equals("exit", line, StringComparison.OrdinalIgnoreCase))
                    {
                        return;
                    }

                    Console.WriteLine("Unknown command. Enter 'q' to quit.");
                }
            }
        }
Example #13
0
        static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.ColoredConsole()
                         .MinimumLevel.Warning()
                         .CreateLogger();
            Console.Title = "Halibut Server";
            var certificate = new X509Certificate2("HalibutServer.pfx");

            var endPoint = new IPEndPoint(IPAddress.IPv6Any, 8433);

            var services = new DelegateServiceFactory();

            services.Register <IUserService>(() => new UserService());

            using (var server = new HalibutRuntime(services, certificate))
            {
                server.Poll(new Uri("poll://SQ-TENTAPOLL"), new ServiceEndPoint(new Uri("wss://localhost:8433/Halibut"), SslCertificateThumbprint));
                Console.WriteLine("Server listening on port 8433. Type 'exit' to quit, or 'cls' to clear...");
                while (true)
                {
                    var line = Console.ReadLine();
                    if (string.Equals("cls", line, StringComparison.OrdinalIgnoreCase))
                    {
                        Console.Clear();
                        continue;
                    }

                    if (string.Equals("q", line, StringComparison.OrdinalIgnoreCase))
                    {
                        return;
                    }

                    if (string.Equals("exit", line, StringComparison.OrdinalIgnoreCase))
                    {
                        return;
                    }

                    Console.WriteLine("Unknown command. Enter 'q' to quit.");
                }
            }
        }
Example #14
0
        public static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                .WriteTo.ColoredConsole()
                .CreateLogger();

            Console.Title = "Halibut Server";
            var certificate = new X509Certificate2("HalibutServer.pfx");

            var endPoint = new IPEndPoint(IPAddress.IPv6Any, 8433);

            var services = new DelegateServiceFactory();
            services.Register<ICalculatorService>(() => new CalculatorService());

            using (var server = new HalibutRuntime(services, certificate))
            {
                server.Listen(endPoint);
                server.Trust("2074529C99D93D5955FEECA859AEAC6092741205");

                Console.WriteLine("Server listening on port 8433. Type 'exit' to quit, or 'cls' to clear...");

                while (true)
                {
                    var line = Console.ReadLine();
                    if (string.Equals("cls", line, StringComparison.OrdinalIgnoreCase))
                    {
                        Console.Clear();
                        continue;
                    }

                    if (string.Equals("q", line, StringComparison.OrdinalIgnoreCase))
                        return;

                    if (string.Equals("exit", line, StringComparison.OrdinalIgnoreCase))
                        return;

                    Console.WriteLine("Unknown command. Enter 'q' to quit.");
                }
            }
        }
Example #15
0
        static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.ColoredConsole()
                         .CreateLogger();

            var services = new DelegateServiceFactory();

            services.Register <ICalculatorService>(() => new CalculatorService());

            using (var client = new HalibutRuntime(services, ClientCertificate))
                using (var server = new HalibutRuntime(services, ServerCertificate))
                {
                    var octopusPort = client.Listen();
                    client.Trust(ServerCertificate.Thumbprint);

                    server.Poll(new Uri(PollUrl), new ServiceEndPoint(new Uri("https://localhost:" + octopusPort), ClientCertificate.Thumbprint));

                    var calculator = client.CreateClient <ICalculatorService>(PollUrl, ServerCertificate.Thumbprint);
                    var result     = calculator.Add(12, 18);
                    Debug.Assert(result == 30);
                }
            Console.ReadKey();
        }
Example #16
0
        public void SupportsDifferentServiceContractMethods()
        {
            services.Register <ISupportedServices>(() => new SupportedServices());
            using (var octopus = new HalibutRuntime(Certificates.Octopus))
                using (var tentacleListening = new HalibutRuntime(services, Certificates.TentacleListening))
                {
                    tentacleListening.Trust(Certificates.OctopusPublicThumbprint);
                    var tentaclePort = tentacleListening.Listen();

                    var echo = octopus.CreateClient <ISupportedServices>("https://localhost:" + tentaclePort, Certificates.TentacleListeningPublicThumbprint);
                    echo.MethodReturningVoid(12, 14);

                    Assert.That(echo.Hello(), Is.EqualTo("Hello"));
                    Assert.That(echo.Hello("a"), Is.EqualTo("Hello a"));
                    Assert.That(echo.Hello("a", "b"), Is.EqualTo("Hello a b"));
                    Assert.That(echo.Hello("a", "b", "c"), Is.EqualTo("Hello a b c"));
                    Assert.That(echo.Hello("a", "b", "c", "d"), Is.EqualTo("Hello a b c d"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e"), Is.EqualTo("Hello a b c d e"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e", "f"), Is.EqualTo("Hello a b c d e f"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e", "f", "g"), Is.EqualTo("Hello a b c d e f g"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e", "f", "g", "h"), Is.EqualTo("Hello a b c d e f g h"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e", "f", "g", "h", "i"), Is.EqualTo("Hello a b c d e f g h i"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e", "f", "g", "h", "i", "j"), Is.EqualTo("Hello a b c d e f g h i j"));
                    Assert.That(echo.Hello("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"), Is.EqualTo("Hello a b c d e f g h i j k"));

                    Assert.That(echo.Add(1, 2), Is.EqualTo(3));
                    Assert.That(echo.Add(1.00, 2.00), Is.EqualTo(3.00));
                    Assert.That(echo.Add(1.10M, 2.10M), Is.EqualTo(3.20M));

                    Assert.That(echo.Ambiguous("a", "b"), Is.EqualTo("Hello string"));
                    Assert.That(echo.Ambiguous("a", new Tuple <string, string>("a", "b")), Is.EqualTo("Hello tuple"));

                    var ex = Assert.Throws <HalibutClientException>(() => echo.Ambiguous("a", (string)null));
                    Assert.That(ex.Message, Is.StringContaining("Ambiguous"));
                }
        }
 public void SetUp()
 {
     services = new DelegateServiceFactory();
     services.Register<IEchoService>(() => new EchoService());
 }
Example #18
0
        public void Start()
        {
            if (!Directory.Exists(SourcesPath))
            {
                Log.Fatal("{@SourcesPath} doesn't exist; service has nothing to do without sources", SourcesPath);
                Stop();
                return;
            }

            if (!Directory.Exists(SinksPath))
            {
                Log.Warning("{@SinksPath} doesn't exist; service has nothing to do without sinks", SinksPath);
            }

            _childDevices.CollectionChanged += (sender, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (IDualShockDevice item in args.NewItems)
                    {
                        Log.Information("Device {Device} got attached via {ConnectionType}", item,
                                        item.ConnectionType);
                        foreach (var plugin in SinkPlugins.Select(p => p.Value))
                        {
                            plugin.DeviceArrived(item);
                        }
                    }

                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (IDualShockDevice item in args.OldItems)
                    {
                        Log.Information("Device {Device} got removed via {ConnectionType}", item,
                                        item.ConnectionType);
                        foreach (var plugin in SinkPlugins.Select(p => p.Value))
                        {
                            plugin.DeviceRemoved(item);
                        }
                    }

                    break;
                }
            };

            #region MEF

            //Creating an instance of aggregate catalog. It aggregates other catalogs
            var aggregateCatalog = new AggregateCatalog();

            //Load parts from the current assembly if available
            var asmCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());

            //Add to the aggregate catalog
            aggregateCatalog.Catalogs.Add(new DirectoryCatalog(SourcesPath, "*.dll"));
            aggregateCatalog.Catalogs.Add(new DirectoryCatalog(SinksPath, "*.dll"));
            aggregateCatalog.Catalogs.Add(asmCatalog);

            //Crete the composition container
            var container = new CompositionContainer(aggregateCatalog);

            // Composable parts are created here i.e.
            // the Import and Export components assembles here
            container.ComposeParts(this);

            #endregion

            // Log loaded sink plugins
            foreach (var plugin in SinkPlugins)
            {
                Log.Information("Loaded sink plugin {Plugin}", plugin.Metadata["Name"]);

                plugin.Value.RumbleRequestReceived += (sender, args) =>
                                                      _childDevices[(IDualShockDevice)sender].Rumble(args.LargeMotor, args.SmallMotor);
            }

            // Log and enable sources
            foreach (var emulator in BusEmulators)
            {
                Log.Information("Loaded bus emulator {Emulator}", emulator.Metadata["Name"]);

                emulator.Value.ChildDeviceAttached += (sender, args) => _childDevices.Add(args.Device);
                emulator.Value.ChildDeviceRemoved  += (sender, args) => _childDevices.Remove(args.Device);
                emulator.Value.InputReportReceived += EmulatorOnInputReportReceived;

                try
                {
                    Log.Information("Starting bus emulator {Emulator}", emulator.Metadata["Name"]);
                    emulator.Value.Start();
                    Log.Information("Bus emulator {Emulator} started successfully", emulator.Metadata["Name"]);
                }
                catch (Exception ex)
                {
                    Log.Error("Failed to start {@emulator}: {@ex}", emulator.Metadata["Name"], ex);
                }
            }

            #region IPC

            var services = new DelegateServiceFactory();
            services.Register <IPairingService>(() =>
            {
                var service = new PairingService();

                service.DeviceListRequested += (sender, args) => _childDevices
                                               .Where(d => d.ConnectionType.Equals(DualShockConnectionType.USB))
                                               .Select(d => new DualShockDeviceDescriptor
                {
                    ClientAddress  = new UniqueAddress(d.ClientAddress),
                    ConnectionType = d.ConnectionType,
                    DeviceType     = d.DeviceType,
                    HostAddress    = new UniqueAddress(d.HostAddress)
                }).ToList();

                service.DevicePairingRequested += (device, args) =>
                                                  _childDevices[device.ClientAddress].PairTo(new PhysicalAddress(args.HostAddress.AddressBytes));

                return(service);
            });

            _ipcServer = new HalibutRuntime(services, Configuration.ServerCertificate);
            _ipcServer.Listen(Configuration.ServerEndpoint);
            _ipcServer.Trust(Configuration.ClientCertificate.Thumbprint);

            #endregion
        }
Example #19
0
        public void Start()
        {
            if (!Directory.Exists(SourcesPath))
            {
                Log.Fatal("{@SourcesPath} doesn't exist; service has nothing to do without sources", SourcesPath);
                Stop();
                return;
            }

            if (!Directory.Exists(SinksPath))
            {
                Log.Warning("{@SinksPath} doesn't exist; service has nothing to do without sinks", SinksPath);
            }

            _childDevices.CollectionChanged += (sender, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (IDualShockDevice item in args.NewItems)
                    {
                        Log.Information("Device {Device} got attached via {ConnectionType}", item,
                                        item.ConnectionType);

                        // Crude auto-pairing mechanism in case BthPS3 is present
                        if (item.ConnectionType.Equals(DualShockConnectionType.USB) &&
                            BusEmulators.Select(be => be.Value).Any(b => b.Name == "BthPS3BusEmulator") &&
                            BluetoothAdapter.GetDefault() != null)
                        {
                            // Check if newly connected USB device is already connected via Bluetooth
                            if (item.ConnectionType.Equals(DualShockConnectionType.USB))
                            {
                                var emulator = BusEmulators.Select(be => be.Value).Where(b => b.Name == "BthPS3BusEmulator").First();

                                foreach (var otherItem in _childDevices)
                                {
                                    if (otherItem.ConnectionType.Equals(DualShockConnectionType.Bluetooth))
                                    {
                                        if (otherItem.ClientAddress.Equals(item.ClientAddress))     // If found remove bluetooth device
                                        {
                                            emulator.RemoveDevice(otherItem);
                                            break;
                                        }
                                    }
                                }
                            }

                            // Get address of detected primary radio
                            var hostAddress = new PhysicalAddress(BitConverter
                                                                  .GetBytes(BluetoothAdapter.GetDefault().BluetoothAddress).Take(6).Reverse()
                                                                  .ToArray());

                            if (!item.HostAddress.Equals(hostAddress))
                            {
                                Log.Information("Auto-pairing device {Device} to {HostAddress}",
                                                item, hostAddress.AsFriendlyName());

                                // Pair USB device
                                item.PairTo(hostAddress);
                            }
                            else
                            {
                                Log.Information("Device {Device} already paired to this radio {HostAddress}.", item, hostAddress.AsFriendlyName());
                            }
                        }
                        else
                        {
                            Log.Warning("Auto-pairing not supported as BthPS3 and/or Bluetooth Host Radio not found");
                        }

                        foreach (var plugin in SinkPlugins.Where(p => p.Value.IsEnabled).Select(p => p.Value))
                        {
                            plugin.DeviceArrived(item);
                        }
                    }

                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (IDualShockDevice item in args.OldItems)
                    {
                        Log.Information("Device {Device} got removed via {ConnectionType}", item,
                                        item.ConnectionType);
                        foreach (var plugin in SinkPlugins.Where(p => p.Value.IsEnabled).Select(p => p.Value))
                        {
                            plugin.DeviceRemoved(item);
                        }
                    }

                    break;
                }

                UpdateLEDS();
            };

            #region MEF

            //Creating an instance of aggregate catalog. It aggregates other catalogs
            var aggregateCatalog = new AggregateCatalog();

            //Load parts from the current assembly if available
            var asmCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());

            //Add to the aggregate catalog
            aggregateCatalog.Catalogs.Add(new DirectoryCatalog(SourcesPath, "*.dll"));
            aggregateCatalog.Catalogs.Add(new DirectoryCatalog(SinksPath, "*.dll"));
            aggregateCatalog.Catalogs.Add(asmCatalog);

            //Crete the composition container
            var container = new CompositionContainer(aggregateCatalog);

            // Composable parts are created here i.e.
            // the Import and Export components assembles here
            container.ComposeParts(this);

            #endregion

            // Log loaded sink plugins
            foreach (var plugin in SinkPlugins.Where(p => p.Value.IsEnabled))
            {
                Log.Information("Loaded sink plugin {Plugin}", plugin.Metadata["Name"]);

                plugin.Value.RumbleRequestReceived += (sender, args) =>
                                                      _childDevices[(IDualShockDevice)sender].Rumble(args.LargeMotor, args.SmallMotor);
            }

            // Log and enable sources
            foreach (var emulator in BusEmulators.Where(p => p.Value.IsEnabled))
            {
                Log.Information("Loaded bus emulator {Emulator}", emulator.Metadata["Name"]);

                emulator.Value.ChildDeviceAttached += (sender, args) => _childDevices.Add(args.Device);
                emulator.Value.ChildDeviceRemoved  += (sender, args) => _childDevices.Remove(args.Device);
                emulator.Value.InputReportReceived += EmulatorOnInputReportReceived;

                try
                {
                    Log.Information("Starting bus emulator {Emulator}", emulator.Metadata["Name"]);
                    emulator.Value.Start();
                    Log.Information("Bus emulator {Emulator} started successfully", emulator.Metadata["Name"]);
                }
                catch (Exception ex)
                {
                    Log.Error("Failed to start {@emulator}: {@ex}", emulator.Metadata["Name"], ex);
                }
            }

            #region IPC

            if (Config.Global.Core.Halibut.IsEnabled)
            {
                var services = new DelegateServiceFactory();
                services.Register <IPairingService>(() =>
                {
                    var service = new PairingService();

                    service.DeviceListRequested += (sender, args) => _childDevices
                                                   .Where(d => d.ConnectionType.Equals(DualShockConnectionType.USB))
                                                   .Select(d => new DualShockDeviceDescriptor
                    {
                        ClientAddress  = new UniqueAddress(d.ClientAddress),
                        ConnectionType = d.ConnectionType,
                        DeviceType     = d.DeviceType,
                        HostAddress    = new UniqueAddress(d.HostAddress)
                    }).ToList();

                    service.DevicePairingRequested += (device, args) =>
                                                      _childDevices[device.ClientAddress].PairTo(new PhysicalAddress(args.HostAddress.AddressBytes));

                    return(service);
                });

                _ipcServer = new HalibutRuntime(services, Configuration.ServerCertificate);
                _ipcServer.Listen(Configuration.ServerEndpoint);
                _ipcServer.Trust(Configuration.ClientCertificate.Thumbprint);
            }

            #endregion

            Task.Factory.StartNew(PollBatteryLevel, _inputCancellationTokenSource.Token);
        }
Example #20
0
 public UsageFixture()
 {
     services = new DelegateServiceFactory();
     services.Register <IEchoService>(() => new EchoService());
 }
Example #21
0
 public void SetUp()
 {
     services = new DelegateServiceFactory();
     services.Register <IEchoService>(() => new EchoService());
 }
Example #22
0
 public FailureModesFixture()
 {
     services = new DelegateServiceFactory();
     services.Register <IEchoService>(() => new EchoService());
 }