Esempio n. 1
0
            public void WhenGivenExistingSiteMigrateData()
            {
                var newSiteOptions          = MockEnvironment.TableauSignInOptions("https://tableau-dev.traffk.com/#/site/TestMasterTenant").Object;
                var tableauAdminCredentials = ConfigurationHelpers.CreateOptions(TableauAdminCredentials);
                var httpClientOptions       = ConfigurationHelpers.CreateOptions(HttpClientOptions);
                var httpClientFactory       = new HttpClientFactory(httpClientOptions);

                var testAdminService =
                    new TableauAdminService(newSiteOptions, tableauAdminCredentials, httpClientFactory, Logger) as ITableauAdminService;

                var    dbUserName           = "******";
                var    dbPassword           = "******";
                var    testNewServerAddress = "traffkrdb-dev.database.windows.net/";
                var    testDbName           = "TraffkHip2";
                string path = Path.GetTempPath();

                path = path + @"TableauIntegrationTestFiles";

                var dataMigrationRequest = new TableauDataMigrationRequest("ExistingTestTenant", testNewServerAddress, testDbName, dbUserName, dbPassword, path);

                testAdminService.MigrateDataset(dataMigrationRequest);

                DirectoryInfo di = new DirectoryInfo(path);

                foreach (FileInfo file in di.GetFiles())
                {
                    file.Delete();
                }
                foreach (DirectoryInfo dir in di.GetDirectories())
                {
                    dir.Delete(true);
                }
            }
Esempio n. 2
0
            public void WhenGivenUrlSignIn()
            {
                var httpClientOptions = ConfigurationHelpers.CreateOptions(HttpClientOptions);
                var httpClientFactory = new HttpClientFactory(httpClientOptions);

                var testService = new TableauViewerService(Options, TableauUserCredentials, httpClientFactory, Logger);

                Assert.IsNotNull(testService);

                var tableauAdminCredentials = ConfigurationHelpers.CreateOptions(TableauAdminCredentials);

                var testAdminService = new TableauAdminService(Options, tableauAdminCredentials, httpClientFactory, Logger);

                Assert.IsNotNull(testAdminService);
            }