Beispiel #1
0
        public ContractsHttpClientV1Test()
        {
            _persistence = new ContractsMemoryPersistence();
            _controller  = new ContractsController();
            _client      = new ContractsHttpClientV1();
            _service     = new ContractsHttpServiceV1();

            IReferences references = References.FromTuples(
                new Descriptor("eic-contracts", "persistence", "memory", "default", "1.0"), _persistence,
                new Descriptor("eic-contracts", "controller", "default", "default", "1.0"), _controller,
                new Descriptor("eic-contracts", "client", "http", "default", "1.0"), _client,
                new Descriptor("eic-contracts", "service", "http", "default", "1.0"), _service,
                new Descriptor("eic-customers", "client", "null", "default", "1.0"), new MockCustomersClientV1() // new CustomersNullClientV1()
                );

            _controller.SetReferences(references);

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

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

            _fixture = new ContractsClientV1Fixture(_client);

            _service.OpenAsync(null).Wait();
            _client.OpenAsync(null).Wait();
        }
        public ContractsDirectClientV1Test()
        {
            _persistence = new ContractsMemoryPersistence();
            _controller  = new ContractsController();
            _client      = new ContractsDirectClientV1();

            IReferences references = References.FromTuples(
                new Descriptor("eic-contracts", "persistence", "memory", "default", "1.0"), _persistence,
                new Descriptor("eic-contracts", "controller", "default", "default", "1.0"), _controller,
                new Descriptor("eic-contracts", "client", "direct", "default", "1.0"), _client,
                new Descriptor("eic-customers", "client", "null", "default", "1.0"), new CustomersNullClientV1()
                );

            _controller.SetReferences(references);

            _client.SetReferences(references);

            _fixture = new ContractsClientV1Fixture(_client);

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