Beispiel #1
0
        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();
        }
Beispiel #2
0
        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");
        }
Beispiel #3
0
        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");
        }
Beispiel #4
0
        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();
        }