public void EuroToKr()
        {
            // Arrange
            const double expected = 22.35;

            // Act
            var actual = _sut.EuroToKr(3);

            // Assert
            Assert.AreEqual(expected, actual, "Euro til Kroner");
        }
Пример #2
0
        public static void Main(string[] args)
        {
            var exchangeRate = ParseExchangeRate(CurrencyConverter.ExchangeRate);
            var exchange     = ParseExchange();
            var amount       = ParseAmount();

            CurrencyConverter.ChangeExchangeRate(exchangeRate);

            var exchangedAmount = exchange.StartsWith('k')
                ? CurrencyConverter.KrToEuro(amount)
                : CurrencyConverter.EuroToKr(amount);

            var exchangeType = exchange.StartsWith('k') ? "Euro" : "Kr.";

            Console.WriteLine($"Dit beløb efter veksling er: {exchangedAmount} {exchangeType}");
        }