コード例 #1
0
        public void GetDailyRatesTest()
        {
            var service = RestServiceFactory.Create();
            var rates   = service.GetDailyRates(GetValidRatesDate(), "EUR", Language.It);

            AssertValidRatesResponse(rates);
        }
コード例 #2
0
        public void GetDailyRatesAsyncTest()
        {
            var service = RestServiceFactory.Create();
            var task    = service.GetDailyRatesAsync(GetValidRatesDate(), "EUR", Language.It);

            AssertTaskRatesResponse(task);
        }
コード例 #3
0
        public void GetCurrenciesTest()
        {
            var service    = RestServiceFactory.Create();
            var currencies = service.GetCurrencies(Language.It);

            AssertValidCurrenciesResponse(currencies);
        }
コード例 #4
0
        public void GetLatestRatesTest()
        {
            var service = RestServiceFactory.Create();
            var rates   = service.GetLatestRates(Language.It);

            AssertValidLatestRatesResponse(rates);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public void DownloadDailyRatesFileTestPdf()
        {
            var service  = RestServiceFactory.Create();
            var filePath = GetTemporaryFilePath("DownloadDailyRatesFileTest.pdf");

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

            service.DownloadLatestRatesFile(Model.FileFormat.Csv, filePath, Language.It);
            AssertFile(filePath);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        public void GetAnnualAverageRatesTest()
        {
            var service = RestServiceFactory.Create();
            var date    = GetDateOfPreviousYear();
            var rates   = service.GetAnnualAverageRates(date.Year, "EUR", Language.It);

            AssertValidRatesResponse(rates);
        }
コード例 #10
0
        public void RestServiceTest1()
        {
            var customEndpointBaseUrl = "http://www.google.it";
            var service = RestServiceFactory.Create(customEndpointBaseUrl);

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

            AssertTaskRatesResponse(task);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
        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);
        }
コード例 #16
0
ファイル: UnityConfig.cs プロジェクト: ajason1/dtest
        /// <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>();
        }
コード例 #17
0
        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);
        }
コード例 #18
0
        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);
        }
コード例 #19
0
        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);
            }
        }
コード例 #20
0
ファイル: Program.cs プロジェクト: masgeek/pizzaout-xamarin
        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();
        }
コード例 #21
0
 public RestActions()
 {
     _rest = new RestServiceFactory();
 }
コード例 #22
0
        public void RestServiceTest()
        {
            var service = RestServiceFactory.Create();

            Assert.IsNotNull(service);
        }