Ejemplo n.º 1
0
            public async Task WhenSignedInGetUnderlyingDataWithManyRows()
            {
                var httpClientOptions = ConfigurationHelpers.CreateOptions(HttpClientOptions);
                var httpClientFactory = new HttpClientFactory(httpClientOptions);

                var testTimeout = TimeSpan.FromHours(12); //Required so that test itself doesn't timeout
                var testMaxRows = 7500000;

                var trustedTicketGetter = new TrustedTicketGetter(Options, TableauAdminCredentials, TableauTenantFinder, httpClientFactory);
                var testService         = new TableauVisualServices(trustedTicketGetter, Options, Logger, httpClientFactory) as ITableauVisualServices;

                var worksheetName = "Avg Risk by Mbr Relationship";

                var testGetUnderlyingDataOptions = new GetUnderlyingDataOptions {
                    WorksheetName = worksheetName, MaxRows = testMaxRows
                };
                var task = testService.GetUnderlyingDataAsync(testGetUnderlyingDataOptions, "AverageRiskScore",
                                                              "1-AverageRiskScore_demo");

                if (await Task.WhenAny(task, Task.Delay(testTimeout)) == task)
                {
                    var data      = task.Result;
                    var dataTable = data.ToDataTable();
                    Assert.IsNotNull(data);
                    Assert.IsNotNull(dataTable);
                }
                else
                {
                    throw new Exception("Timed Out");
                }
            }
Ejemplo n.º 2
0
            public async Task WhenSignedInGetUnderlyingDataUsingWorksheetName()
            {
                var httpClientOptions = ConfigurationHelpers.CreateOptions(HttpClientOptions);
                var httpClientFactory = new HttpClientFactory(httpClientOptions);

                var testTimeout = TimeSpan.FromHours(12); //Required so that test itself doesn't timeou

                var trustedTicketGetter = new TrustedTicketGetter(Options, TableauAdminCredentials, TableauTenantFinder, httpClientFactory);
                var testService         = new TableauVisualServices(trustedTicketGetter, Options, Logger, httpClientFactory) as ITableauVisualServices;

                var worksheetName = "Risk by Occupation";
                var testGetUnderlyingDataOptions = new GetUnderlyingDataOptions {
                    WorksheetName = worksheetName
                };

                //var task = testService.GetUnderlyingDataAsync(testGetUnderlyingDataOptions, "RiskIndex-Occupations",
                //    "EmploymentandRisk").ExecuteSynchronously();

                var task = testService.GetUnderlyingDataAsync(testGetUnderlyingDataOptions, "RiskIndex-Occupations",
                                                              "EmploymentandRisk");

                if (await Task.WhenAny(task, Task.Delay(testTimeout)) == task)
                {
                    task.ExecuteSynchronously();
                    var data      = task.Result;
                    var dataTable = data.ToDataTable();
                    Assert.IsNotNull(data);
                    Assert.IsNotNull(dataTable);
                }
                else
                {
                    throw new Exception("Timed Out");
                }
            }
Ejemplo n.º 3
0
            public void WhenSignedInGetUnderlyingDataUsingDashboardName()
            {
                var httpClientOptions = ConfigurationHelpers.CreateOptions(HttpClientOptions);
                var httpClientFactory = new HttpClientFactory(httpClientOptions);

                var trustedTicketGetter = new TrustedTicketGetter(Options, TableauAdminCredentials, TableauTenantFinder, httpClientFactory);
                var testService         = new TableauVisualServices(trustedTicketGetter, Options, Logger, httpClientFactory) as ITableauVisualServices;

                var dashboardName = "Employment and Risk";
                var testGetUnderlyingDataOptions = new GetUnderlyingDataOptions {
                    DashboardName = dashboardName
                };
                var data = testService.GetUnderlyingDataAsync(testGetUnderlyingDataOptions, "RiskIndex-Occupations",
                                                              "EmploymentandRisk").ExecuteSynchronously();
                var dataTable = data.ToDataTable();

                Assert.IsNotNull(data);
                Assert.IsNotNull(dataTable);
            }