Beispiel #1
0
        public LimitsHttpClientV1Test()
        {
            _persistence = new LimitsMemoryPersistence();
            _persistence.Configure(new ConfigParams());

            _controller = new LimitsController();
            _controller.Configure(new ConfigParams());

            _client  = new LimitsHttpClientV1();
            _service = new LimitsHttpServiceV1();


            ConfigParams HttpConfig = ConfigParams.FromTuples(
                "connection.protocol", "http",
                "connection.host", "localhost",
                "connection.port", 3000
                );

            _service.Configure(HttpConfig);
            _client.Configure(HttpConfig);

            _fixture = new LimitsClientV1Fixture(_client);

            IReferences references = References.FromTuples(
                new Descriptor("pip-services-limits-dotnet", "persistence", "memory", "default", "1.0"), _persistence,
                new Descriptor("pip-services-limits-dotnet", "controller", "default", "default", "1.0"), _controller,
                new Descriptor("pip-services-limits-dotnet", "client", "http", "default", "1.0"), _client,
                new Descriptor("pip-services-limits-dotnet", "service", "http", "default", "1.0"), _service
                );

            _controller.SetReferences(references);
            _client.SetReferences(references);
            _service.SetReferences(references);

            _persistence.OpenAsync(null).Wait();
            _service.OpenAsync(null).Wait();
            _client.OpenAsync(null).Wait();
        }
Beispiel #2
0
        public LimitsDirectClientV1Test()
        {
            _persistence = new LimitsMemoryPersistence();
            _persistence.Configure(new ConfigParams());

            _controller = new LimitsController();
            _controller.Configure(new ConfigParams());

            _client = new LimitsDirectClientV1();

            IReferences references = References.FromTuples(
                new Descriptor("pip-services-limits-dotnet", "persistence", "memory", "default", "1.0"), _persistence,
                new Descriptor("pip-services-limits-dotnet", "controller", "default", "default", "1.0"), _controller,
                new Descriptor("pip-services-limits-dotnet", "client", "direct", "default", "1.0"), _client
                );

            _controller.SetReferences(references);

            _client.SetReferences(references);

            _fixture = new LimitsClientV1Fixture(_client);

            _persistence.OpenAsync(null).Wait();
        }