Exemplo n.º 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();
        }
Exemplo n.º 2
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");
        }
Exemplo n.º 3
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();
        }