Ejemplo n.º 1
0
        public CurrencyConverterViewModelTests()
        {
            var mockClient = new Mock <ICurrencyServiceClient>();

            mockClient.Setup(f => f.GetCurrencies()).Returns(Task.FromResult(_testCurrencies));
            mockClient.Setup(f => f.GetConversionRate("USD", "EUR"))
            .Returns(Task.FromResult(
                         new CurrencyConversion("USD", "EUR", 0.81357M)));
            mockClient.Setup(f => f.GetConversionRate("USD", "CAD"))
            .Returns(Task.FromResult(
                         new CurrencyConversion("USD", "CAD", 1.2854M)));
            _testClient = mockClient.Object;
        }
Ejemplo n.º 2
0
 public CurrencyConverterViewModel(ICurrencyServiceClient client)
 {
     _serviceClient = client ?? throw new ArgumentNullException(nameof(client));
 }