public string MainService() { var jsonData = _rateApiReader.ReadRates(); foreach (var jsonRate in jsonData.Rates) { _repository.Insert(jsonRate); } var goodDates = new List <IRate>(); foreach (var rate in _repository.GetAll()) { goodDates.Add(_rateFactory.SaveRate(rate)); } string json = ""; foreach (var element in goodDates) { json += JsonConvert.SerializeObject(element); } return(json); }
public void CorrectRateFactoryResult() { var rate = _factory.SaveRate(_correctJsonRate); Assert.IsInstanceOfType(rate, typeof(Rate)); }