diff --git a/jobs/Backend/Task/Currency.cs b/jobs/Backend/Task/Currency.cs
deleted file mode 100644
index f375776f2..000000000
--- a/jobs/Backend/Task/Currency.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace ExchangeRateUpdater
-{
- public class Currency
- {
- public Currency(string code)
- {
- Code = code;
- }
-
- ///
- /// Three-letter ISO 4217 code of the currency.
- ///
- public string Code { get; }
-
- public override string ToString()
- {
- return Code;
- }
- }
-}
diff --git a/jobs/Backend/Task/ExchangeRate.cs b/jobs/Backend/Task/ExchangeRate.cs
deleted file mode 100644
index 58c5bb10e..000000000
--- a/jobs/Backend/Task/ExchangeRate.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace ExchangeRateUpdater
-{
- public class ExchangeRate
- {
- public ExchangeRate(Currency sourceCurrency, Currency targetCurrency, decimal value)
- {
- SourceCurrency = sourceCurrency;
- TargetCurrency = targetCurrency;
- Value = value;
- }
-
- public Currency SourceCurrency { get; }
-
- public Currency TargetCurrency { get; }
-
- public decimal Value { get; }
-
- public override string ToString()
- {
- return $"{SourceCurrency}/{TargetCurrency}={Value}";
- }
- }
-}
diff --git a/jobs/Backend/Task/ExchangeRateProvider.cs b/jobs/Backend/Task/ExchangeRateProvider.cs
deleted file mode 100644
index 6f82a97fb..000000000
--- a/jobs/Backend/Task/ExchangeRateProvider.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace ExchangeRateUpdater
-{
- public class ExchangeRateProvider
- {
- ///
- /// Should return exchange rates among the specified currencies that are defined by the source. But only those defined
- /// by the source, do not return calculated exchange rates. E.g. if the source contains "CZK/USD" but not "USD/CZK",
- /// do not return exchange rate "USD/CZK" with value calculated as 1 / "CZK/USD". If the source does not provide
- /// some of the currencies, ignore them.
- ///
- public IEnumerable GetExchangeRates(IEnumerable currencies)
- {
- return Enumerable.Empty();
- }
- }
-}
diff --git a/jobs/Backend/Task/ExchangeRateUpdater.Tests/CnbXmlParserTests.cs b/jobs/Backend/Task/ExchangeRateUpdater.Tests/CnbXmlParserTests.cs
new file mode 100644
index 000000000..d1057e124
--- /dev/null
+++ b/jobs/Backend/Task/ExchangeRateUpdater.Tests/CnbXmlParserTests.cs
@@ -0,0 +1,43 @@
+using System.Linq;
+using ExchangeRateUpdater.Exceptions;
+using ExchangeRateUpdater.Models;
+using ExchangeRateUpdater.Parsers;
+using NUnit.Framework;
+
+namespace ExchangeRateUpdater.Tests;
+
+[TestFixture]
+public class CnbXmlParserTests
+{
+ [Test]
+ public void Parse_ValidXml_ReturnsCorrectExchangeRates()
+ {
+ // Arrange
+ var parser = new CnbXmlParser();
+ var baseCurrency = new Currency("CZK");
+
+ // Act
+ var rates = parser.Parse(TestData.CnbExchangeRateXml, baseCurrency).ToList();
+
+ // Assert
+
+ Assert.That(rates.Count, Is.EqualTo(31));
+
+ var audRate = rates.FirstOrDefault(r => r.TargetCurrency.Code == "AUD");
+ Assert.That(audRate.SourceCurrency.Code, Is.EqualTo("CZK"));
+ Assert.That(audRate.Value, Is.EqualTo(13.862m));
+ }
+ [Test]
+ public void Parse_InvalidXml_ReturnsCorrectExchangeRates()
+ {
+ // Arrange
+ var parser = new CnbXmlParser();
+ var baseCurrency = new Currency("CZK");
+
+ // Act
+ // Assert
+ Assert.Throws(() => parser.Parse(TestData.InvalidCnbExchangeRateXml, baseCurrency));
+
+
+ }
+}
\ No newline at end of file
diff --git a/jobs/Backend/Task/ExchangeRateUpdater.Tests/ExchangeRateControllerTests.cs b/jobs/Backend/Task/ExchangeRateUpdater.Tests/ExchangeRateControllerTests.cs
new file mode 100644
index 000000000..e9bfa51e1
--- /dev/null
+++ b/jobs/Backend/Task/ExchangeRateUpdater.Tests/ExchangeRateControllerTests.cs
@@ -0,0 +1,154 @@
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using ExchangeRateUpdater.Controllers;
+using ExchangeRateUpdater.Models;
+using ExchangeRateUpdater.Services;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Caching.Memory;
+using Microsoft.Extensions.Configuration;
+using Moq;
+using Moq.Protected;
+using NUnit.Framework;
+
+namespace ExchangeRateUpdater.Tests;
+
+[TestFixture]
+public class ExchangeRateControllerTests
+{
+ private ExchangeRateController _controller;
+ private IConfiguration _configuration;
+ private Mock _mockCache;
+ private ExchangeRateSettingsResolver _settingsResolver;
+ private ExchangeRateProvider _provider;
+
+ [SetUp]
+ public void Setup()
+ {
+ _configuration = new ConfigurationBuilder()
+ .SetBasePath(TestContext.CurrentContext.TestDirectory)
+ .AddJsonFile("appsettings.test.json", optional: false)
+ .Build();
+ _mockCache = new Mock();
+
+
+ _settingsResolver = new ExchangeRateSettingsResolver(_configuration);
+ _mockCache.Setup(m => m.TryGetValue(It.IsAny