public static void TestClassInitialize(TestContext testContext) { Test.Info(string.Format("{0} Class Initialize", testContext.FullyQualifiedTestClassName)); Test.FullClassName = testContext.FullyQualifiedTestClassName; StorageAccount = GetCloudStorageAccountFromConfig(); //init the blob helper for blob related operations blobUtil = new CloudBlobUtil(StorageAccount); queueUtil = new CloudQueueUtil(StorageAccount); tableUtil = new CloudTableUtil(StorageAccount); // import module string moduleFilePath = Test.Data.Get("ModuleFilePath"); PowerShellAgent.ImportModule(moduleFilePath); //set the default storage context PowerShellAgent.SetStorageContext(StorageAccount.ToString(true)); random = new Random(); ContainerInitCount = blobUtil.GetExistingContainerCount(); QueueInitCount = queueUtil.GetExistingQueueCount(); TableInitCount = tableUtil.GetExistingTableCount(); }
public static void TestClassCleanup() { int count = blobUtil.GetExistingContainerCount(); // FIXME: For now, the new storage account could not work against // normal storage account. So comment these operations which has // nothing to do with cloud file service and will certainly fail. ////string message = string.Format("there are {0} containers before running mutiple unit tests, after is {1}", ContainerInitCount, count); ////AssertCleanupOnStorageObject("containers", ContainerInitCount, count); ////count = queueUtil.GetExistingQueueCount(); ////AssertCleanupOnStorageObject("queues", QueueInitCount, count); ////count = tableUtil.GetExistingTableCount(); ////AssertCleanupOnStorageObject("tables", TableInitCount, count); if (null != CommandAgent) { CommandAgent.Dispose(); CommandAgent = null; } Test.Info("Test Class Cleanup"); }
public static void TestClassCleanup() { int count = blobUtil.GetExistingContainerCount(); string message = string.Format("there are {0} containers before running mutiple unit tests, after is {1}", ContainerInitCount, count); AssertCleanupOnStorageObject("containers", ContainerInitCount, count); count = queueUtil.GetExistingQueueCount(); AssertCleanupOnStorageObject("queues", QueueInitCount, count); count = tableUtil.GetExistingTableCount(); AssertCleanupOnStorageObject("tables", TableInitCount, count); Test.Info("Test Class Cleanup"); }