コード例 #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);
                }
            }
コード例 #2
0
        public TableauRestServiceTests()
        {
            Options             = MockEnvironment.TableauSignInOptions().Object;
            TableauTenantFinder = MockEnvironment.TableauTenantFinder().Object;
            var tableauAdminCredentials = MockEnvironment.TableauAdminCredentials().Object;

            TableauAdminCredentials = new TableauAdminCredentials
            {
                Username = tableauAdminCredentials.UserName,
                Password = tableauAdminCredentials.Password
            };
            TableauUserCredentials = MockEnvironment.TableauUserCredentials().Object;
            Logger = MockEnvironment.CreateTestLogger();
        }