示例#1
0
        public async Task Handle_ResponseOrderedByAbbreviation()
        {
            var bitcoinPriceService = BitcoinPriceServiceFactory.Create();
            var dictionary          = BitcoinPriceServiceFactory.GetDictionary();
            var mapper  = AutoMapperFactory.Create();
            var handler = new GetAllCurrenciesQuery.Handler(bitcoinPriceService.Object,
                                                            mapper);

            var res =
                await handler.Handle(new GetAllCurrenciesQuery(), CancellationToken.None);

            Assert.Equal(dictionary.OrderBy(x => x.Key).First().Key, res.Data.First().Abbreviation);
        }
示例#2
0
        public async Task Handle_ReturnsResponse()
        {
            var bitcoinPriceService = BitcoinPriceServiceFactory.Create();
            var dictionary          = BitcoinPriceServiceFactory.GetDictionary();
            var mapper  = AutoMapperFactory.Create();
            var handler = new GetAllCurrenciesQuery.Handler(bitcoinPriceService.Object,
                                                            mapper);

            var res =
                await handler.Handle(new GetAllCurrenciesQuery(), CancellationToken.None);

            Assert.Equal(dictionary.Count, res.Count);
            Assert.Equal(dictionary.Count, res.Data.Count);
        }