Beispiel #1
0
        public GuidesHttpClientV1Test()
        {
            var persistence = new GuidesMemoryPersistence();
            var controller  = new GuidesController();

            _client  = new GuidesHttpClientV1();
            _service = new GuidesHttpServiceV1();

            IReferences references = References.FromTuples(
                new Descriptor("wexxle-guides", "persistence", "memory", "default", "1.0"), persistence,
                new Descriptor("wexxle-guides", "controller", "default", "default", "1.0"), controller,
                new Descriptor("wexxle-guides", "client", "http", "default", "1.0"), _client,
                new Descriptor("wexxle-guides", "service", "http", "default", "1.0"), _service,
                new Descriptor("wexxle-attachments", "client", "null", "default", "1.0"), new AttachmentsNullClientV1()
                );

            controller.SetReferences(references);

            _service.Configure(HttpConfig);
            _service.SetReferences(references);

            _client.Configure(HttpConfig);
            _client.SetReferences(references);

            _fixture = new GuidesClientV1Fixture(_client);

            _service.OpenAsync(null).Wait();
            _client.OpenAsync(null).Wait();
        }
Beispiel #2
0
        public GuidesDirectClientV1Test()
        {
            var persistence = new GuidesMemoryPersistence();
            var controller  = new GuidesController();
            var client      = new GuidesDirectClientV1();

            IReferences references = References.FromTuples(
                new Descriptor("wexxle-guides", "persistence", "memory", "default", "1.0"), persistence,
                new Descriptor("wexxle-guides", "controller", "default", "default", "1.0"), controller,
                new Descriptor("wexxle-guides", "client", "direct", "default", "1.0"), client,
                new Descriptor("wexxle-attachments", "client", "null", "default", "1.0"), new AttachmentsNullClientV1()
                );

            controller.SetReferences(references);

            client.SetReferences(references);

            _fixture = new GuidesClientV1Fixture(client);

            client.OpenAsync(null).Wait();
        }
Beispiel #3
0
        public GuidesHttpServiceV1BeforeAll()
        {
            Persistence = new GuidesMemoryPersistence();
            Controller  = new GuidesController();
            Service     = new GuidesHttpServiceV1();
            _cache      = new NullCache();

            References = PipServices3.Commons.Refer.References.FromTuples(
                new Descriptor("wexxle-guides", "persistence", "memory", "default", "1.0"), Persistence,
                new Descriptor("pip-services3", "cache", "null", "default", "1.0"), _cache,
                new Descriptor("wexxle-guides", "controller", "default", "default", "1.0"), Controller,
                new Descriptor("wexxle-guides", "service", "http", "default", "1.0"), Service,
                new Descriptor("wexxle-attachments", "client", "null", "default", "1.0"), new AttachmentsNullClientV1()
                );

            Controller.SetReferences(References);

            Service.Configure(HttpConfig);
            Service.SetReferences(References);

            Task.Run(() => Service.OpenAsync(null));
            Thread.Sleep(1000);
        }