Exemplo n.º 1
0
        public async Task PairingServiceWithNullUrl()
        {
            var restConnector = new RestConnectorBuilder()
                                .WithResult(string.Empty)
                                .Build();
            var ioptions = new OptionBuilder()
                           .BuildNullUrlAppSettings();

            var pairingService = new PairingService(restConnector, ioptions);

            var selectOptions = await pairingService.GetCurrenciesAsync();

            selectOptions.Should().BeEmpty("the result should be empty if there is no configuration available.");
            var pairings = await pairingService.GetPairingAsync(1, 1);

            pairings.Should().BeEmpty("the result should be empty if there is no configuration available.");
        }
Exemplo n.º 2
0
        public async Task GetCurrencies(string result, int length)
        {
            var restConnector = new RestConnectorBuilder()
                                .WithResult(result)
                                .Build();
            var ioptions = new OptionBuilder()
                           .WithDefaultCurrenciesUrl()
                           .Build();

            var pairingService = new PairingService(restConnector, ioptions);

            var selectOptions = await pairingService.GetCurrenciesAsync();

            selectOptions.Should().BeAssignableTo <List <SelectOption> >("the method always returns a list of pairings.");
            var selectOptionList = (List <SelectOption>)selectOptions;

            selectOptionList.Count.Should().Be(length, "the data returned is such.");
        }
Exemplo n.º 3
0
        public async Task GetPairingAsync(string result, int length)
        {
            var restConnector = new RestConnectorBuilder()
                                .WithResult(result)
                                .Build();

            var ioptions = new OptionBuilder()
                           .WithDefaultPairingsUrl()
                           .Build();

            var pairingService = new PairingService(restConnector, ioptions);

            var pairings = await pairingService.GetPairingAsync(1, 1);

            pairings.Should().BeAssignableTo <List <Pairing> >("the method always returns a list of pairings.");
            var pairingList = (List <Pairing>)pairings;

            pairingList.Count.Should().Be(length, "the data returned is such.");
        }