Ejemplo n.º 1
0
 /// <summary>
 /// Create kustopool create parameters.
 /// </summary>
 /// <param name="commonData"></param>
 /// <returns></returns>
 public static KustoPool PrepareKustopoolCreateParams(this CommonTestFixture commonData)
 {
     return(new KustoPool
     {
         Location = commonData.Location,
         Sku = commonData.KustoSku
     });
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create fire wall rule create parameters.
 /// </summary>
 /// <param name="commonData"></param>
 /// <param name="startIpAddress"></param>
 /// <param name="endIpAddress"></param>
 /// <returns></returns>
 public static IpFirewallRuleInfo PrepareFirewallRuleParams(this CommonTestFixture commonData, string startIpAddress, string endIpAddress)
 {
     return(new IpFirewallRuleInfo
     {
         StartIpAddress = startIpAddress,
         EndIpAddress = endIpAddress
     });
 }
Ejemplo n.º 3
0
 public static ReadWriteDatabase PrepareKustoDatabaseCreateParams(this CommonTestFixture commonData)
 {
     return(new ReadWriteDatabase
     {
         Location = commonData.Location,
         SoftDeletePeriod = commonData.SoftDeletePeriod,
         HotCachePeriod = commonData.HotCachePeriod
     });
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create sqlpool create parameters.
 /// </summary>
 /// <param name="commonData"></param>
 /// <returns></returns>
 public static SqlPoolV3 PrepareSqlPoolV3CreateParams(this CommonTestFixture commonData)
 {
     return(new SqlPoolV3
     {
         Location = commonData.Location,
         Sku = new SkuV3
         {
             Name = commonData.PerformanceLevel
         }
     });
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Create workspace create parameters.
 /// </summary>
 /// <param name="commonData"></param>
 /// <returns></returns>
 public static Workspace PrepareWorkspaceCreateParams(this CommonTestFixture commonData)
 {
     return(new Workspace
     {
         Location = commonData.Location,
         Identity = new ManagedIdentity
         {
             Type = ResourceIdentityType.SystemAssigned
         },
         DefaultDataLakeStorage = new DataLakeStorageAccountDetails
         {
             AccountUrl = commonData.DefaultDataLakeStorageAccountUrl,
             Filesystem = commonData.DefaultDataLakeStorageFilesystem
         },
         SqlAdministratorLogin = commonData.SshUsername,
         SqlAdministratorLoginPassword = commonData.SshPassword
     });
 }
        internal virtual void TestInitialize([System.Runtime.CompilerServices.CallerMemberName] string methodName = "testframework_failed")
        {
            Context                 = SynapseMockContext.Start(this.GetType(), methodName);
            CommonData              = new CommonTestFixture();
            SynapseClient           = Context.GetServiceClient <SynapseManagementClient>();
            SynapseManagementHelper = new SynapseManagementHelper(CommonData, Context);

            if (IsRecordMode)
            {
                //set mode to none to skip recoding during setup
                HttpMockServer.Mode = HttpRecorderMode.None;
                SynapseManagementHelper.RegisterSubscriptionForResource("Microsoft.Synapse");
                SynapseManagementHelper.RegisterSubscriptionForResource("Microsoft.Storage");
                this.CreateResources();

                //set mode back to record
                HttpMockServer.Mode = HttpRecorderMode.Record;
                string mockedSubscriptionId = TestUtilities.GenerateGuid().ToString();
                CommonData.SubscriptionId = SynapseManagementTestUtilities.GetSubscriptionId();
                this.Context.AddTextReplacementRule(CommonData.SubscriptionId, mockedSubscriptionId);
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Create spark create parameters.
 /// </summary>
 /// <param name="commonData"></param>
 /// <param name="enableAutoScale"></param>
 /// <param name="enableAutoPause"></param>
 /// <returns></returns>
 public static BigDataPoolResourceInfo PrepareSparkpoolCreateParams(this CommonTestFixture commonData, bool enableAutoScale, bool enableAutoPause)
 {
     return(new BigDataPoolResourceInfo
     {
         Location = commonData.Location,
         NodeCount = enableAutoScale ? (int?)null : commonData.NodeCount,
         NodeSizeFamily = NodeSizeFamily.MemoryOptimized,
         NodeSize = commonData.NodeSize,
         AutoScale = !enableAutoScale ? null : new AutoScaleProperties
         {
             Enabled = enableAutoScale,
             MinNodeCount = commonData.AutoScaleMinNodeCount,
             MaxNodeCount = commonData.AutoScaleMaxNodeCount
         },
         AutoPause = !enableAutoPause ? null : new AutoPauseProperties
         {
             Enabled = enableAutoPause,
             DelayInMinutes = commonData.AutoPauseDelayInMinute
         },
         SparkVersion = commonData.SparkVersion
     });
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="commonData"></param>
 /// <param name="context"></param>
 public SynapseManagementHelper(CommonTestFixture commonData, SynapseMockContext context)
 {
     resourceManagementClient = context.GetServiceClient <ResourceManagementClient>();
     storageManagementClient  = context.GetServiceClient <StorageManagementClient>();
     this.commonData          = commonData;
 }