Exemplo n.º 1
0
        public void ExchangeShouldCalculateCorrectly()
        {
            // Arrange
            var repository = new Mock <IExchangeRateRepository>();

            repository.Setup(x => x.GetExchangeRate(It.IsAny <string>(), It.IsAny <string>())).ReturnsAsync(0.8m);
            var sut = new ExchangeRateService(repository.Object);

            // Act
            var result = sut.Exchange("AUD", "USD", 100);

            // Assert
            Assert.AreEqual(result, 80m);
        }