예제 #1
0
        private DummyRestService CreateService(HttpEndpoint httpEndpoint, ConfigParams config)
        {
            var service = new DummyRestService();

            var references = References.FromTuples(
                new Descriptor("pip-services3-dummies", "controller", "default", "default", "1.0"), new DummyController(),
                new Descriptor("pip-services3", "endpoint", "http", "default", "1.0"), httpEndpoint
                );

            service.Configure(config);
            service.SetReferences(references);
            return(service);
        }
예제 #2
0
        public DummyRestServiceTest()
        {
            _ctrl    = new DummyController();
            _service = new DummyRestService();

            _httpEndpoint = new HttpEndpoint();

            var references = References.FromTuples(
                new Descriptor("pip-services3-dummies", "controller", "default", "default", "1.0"), _ctrl,
                new Descriptor("pip-services3", "endpoint", "http", "default", "1.0"), _httpEndpoint
                );

            _service.Configure(ConfigParams.FromTuples(
                                   "base_route", "/api/v1"
                                   ));

            _httpEndpoint.Configure(RestConfig);

            _service.SetReferences(references);

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