public void GetDailyRatesTest()
        {
            var service = RestServiceFactory.Create();
            var rates   = service.GetDailyRates(GetValidRatesDate(), "EUR", Language.It);

            AssertValidRatesResponse(rates);
        }
        public void GetDailyRatesAsyncTest()
        {
            var service = RestServiceFactory.Create();
            var task    = service.GetDailyRatesAsync(GetValidRatesDate(), "EUR", Language.It);

            AssertTaskRatesResponse(task);
        }
        public void GetCurrenciesTest()
        {
            var service    = RestServiceFactory.Create();
            var currencies = service.GetCurrencies(Language.It);

            AssertValidCurrenciesResponse(currencies);
        }
        public void GetLatestRatesTest()
        {
            var service = RestServiceFactory.Create();
            var rates   = service.GetLatestRates(Language.It);

            AssertValidLatestRatesResponse(rates);
        }
        public void DownloadDailyRatesFileTestXls()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadDailyRatesFileTest.xls");

            service.DownloadDailyRatesFile(Model.FileFormat.Xls, filePath, DateTime.Now, "EUR", Language.It);
            AssertFile(filePath);
        }
        public void DownloadDailyRatesFileTestPdf()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadDailyRatesFileTest.pdf");

            service.DownloadDailyRatesFile(Model.FileFormat.Pdf, filePath, GetValidRatesDate(), "EUR", Language.It);
            AssertFile(filePath);
        }
        public void DownloadLatestRatesFileTest()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadLatestRatesFile.csv");

            service.DownloadLatestRatesFile(Model.FileFormat.Csv, filePath, Language.It);
            AssertFile(filePath);
        }
        public void DownloadDailyRatesFileAsync()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadDailyRatesFileTestAsync.csv");
            var task     = service.DownloadDailyRatesFileAsync(Model.FileFormat.Csv, filePath, DateTime.Now, "EUR", Language.It);

            AssertTaskDownloadFile(filePath, task);
        }
        public void GetAnnualAverageRatesTest()
        {
            var service = RestServiceFactory.Create();
            var date    = GetDateOfPreviousYear();
            var rates   = service.GetAnnualAverageRates(date.Year, "EUR", Language.It);

            AssertValidRatesResponse(rates);
        }
        public void RestServiceTest1()
        {
            var customEndpointBaseUrl = "http://www.google.it";
            var service = RestServiceFactory.Create(customEndpointBaseUrl);

            Assert.IsNotNull(service);
            Assert.IsTrue(customEndpointBaseUrl.Equals(service.EndpointBaseUrl));
        }
        public void GetAnnualAverageRatesAsyncTest()
        {
            var service = RestServiceFactory.Create();
            var date    = GetDateOfPreviousYear();
            var task    = service.GetAnnualAverageRatesAsync(date.Year, "EUR", Language.It);

            AssertTaskRatesResponse(task);
        }
        public void GetAnnualTimeSeriesAsyncTest()
        {
            var service   = RestServiceFactory.Create();
            var endDate   = GetDateOfPreviousMonth();
            var startDate = endDate.AddYears(-10);
            var task      = service.GetAnnualTimeSeriesAsync(startDate.Year, endDate.Year, "GBP", "EUR", Language.It);

            AssertTaskRatesResponse(task);
        }
        public void GetAnnualTimeSeriesTest()
        {
            var service   = RestServiceFactory.Create();
            var endDate   = GetDateOfPreviousMonth();
            var startDate = endDate.AddYears(-10);
            var rates     = service.GetAnnualTimeSeries(startDate.Year, endDate.Year, "GBP", "EUR", Language.It);

            AssertValidRatesResponse(rates);
        }
        public void DownloadAnnualAverageRatesFileAsyncTest()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadAnnualAverageRatesFileAsyncTest.csv");
            var date     = GetDateOfPreviousYear();
            var task     = service.DownloadAnnualAverageRatesFileAsync(Model.FileFormat.Csv, filePath, date.Year, "EUR", Language.It);

            AssertTaskDownloadFile(filePath, task);
        }
        public void DownloadMonthlyAverageRatesFileTest()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadMonthlyAverageRatesFileTest.csv");
            var date     = GetDateOfPreviousMonth();

            service.DownloadMonthlyAverageRatesFile(Model.FileFormat.Csv, filePath, date.Month, date.Year, "EUR", Language.It);
            AssertFile(filePath);
        }
Ejemplo n.º 16
0
        /// <summary>Registers the type mappings with the Unity container.</summary>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>There is no need to register concrete types such as controllers or API controllers (unless you want to
        /// change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.</remarks>
        public static void RegisterTypes(IUnityContainer container)
        {
            // NOTE: To load from web.config uncomment the line below. Make sure to add a Microsoft.Practices.Unity.Configuration to the using statements.
            // container.LoadConfiguration
            var restService = new RestServiceFactory(TimeSpan.FromSeconds(5)).Create();

            container.RegisterInstance(restService);
            container.RegisterType <IPetRepository, PetRepository>();
            container.RegisterType <IPetService, PetService>();
        }
        public void DownloadAnnualTimeSeriesFileAsyncTest()
        {
            var service   = RestServiceFactory.Create();
            var filePath  = GetTemporaryFilePath("DownloadAnnualTimeSeriesFileAsyncTest.csv");
            var endDate   = GetDateOfPreviousMonth();
            var startDate = endDate.AddYears(-10);
            var task      = service.DownloadAnnualTimeSeriesFileAsync(Model.FileFormat.Csv, filePath, startDate.Year, endDate.Year, "GBP", "EUR", Language.It);

            AssertTaskDownloadFile(filePath, task);
        }
        public void DownloadMonthlyTimeSeriesFileTest()
        {
            var service   = RestServiceFactory.Create();
            var filePath  = GetTemporaryFilePath("DownloadMonthlyTimeSeriesFileTest.csv");
            var endDate   = GetDateOfPreviousMonth();
            var startDate = endDate.AddMonths(-8);

            service.DownloadMonthlyTimeSeriesFile(Model.FileFormat.Csv, filePath, startDate.Month, startDate.Year, endDate.Month, endDate.Year, "GBP", "EUR", Language.It);
            AssertFile(filePath);
        }
        public void GetLatestRatesAsyncTest()
        {
            var service = RestServiceFactory.Create();
            var task    = service.GetLatestRatesAsync(Language.It);

            task.Wait();
            Assert.IsTrue(task.IsCompleted);
            if (task.IsCompleted)
            {
                AssertValidLatestRatesResponse(task.Result);
            }
        }
Ejemplo n.º 20
0
        static void Main()
        {
            _rest = RestServiceFactory.Instance;

            //CallOrderRest();
            // CallMenuCategoriesRest();
            //RegisterUserRest();

            //GetCartItems(userId);
            //GetOrderHistory(userId);

            LoginUserRest("fatelord", "andalite6");
            //Console.WriteLine("Hello sammy i am here");
            Console.ReadLine();
        }
Ejemplo n.º 21
0
 public RestActions()
 {
     _rest = new RestServiceFactory();
 }
        public void RestServiceTest()
        {
            var service = RestServiceFactory.Create();

            Assert.IsNotNull(service);
        }