GetPoolCount() public static method

Gets the number of pools under the specified account
public static GetPoolCount ( BatchController controller, BatchAccountContext context ) : int
controller BatchController
context BatchAccountContext
return int
Ejemplo n.º 1
0
        public void TestListAllPools()
        {
            BatchController     controller     = BatchController.NewInstance;
            string              poolId1        = "testList1";
            string              poolId2        = "testList2";
            string              poolId3        = "thirdTestList";
            int                 beforeAddCount = 0;
            int                 afterAddCount  = 0;
            BatchAccountContext context        = null;

            controller.RunPsTestWorkflow(
                () => { return(new string[] { string.Format("Test-ListAllPools '{0}' '{1}'", commonAccountName, afterAddCount) }); },
                () =>
            {
                context        = ScenarioTestHelpers.GetBatchAccountContextWithKeys(controller, commonAccountName);
                beforeAddCount = ScenarioTestHelpers.GetPoolCount(controller, context);
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId1, 0);
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId2, 0);
                ScenarioTestHelpers.CreateTestPool(controller, context, poolId3, 0);
                afterAddCount = beforeAddCount + 3;
            },
                () =>
            {
                ScenarioTestHelpers.DeletePool(controller, context, poolId1);
                ScenarioTestHelpers.DeletePool(controller, context, poolId2);
                ScenarioTestHelpers.DeletePool(controller, context, poolId3);
            },
                TestUtilities.GetCallingClass(),
                TestUtilities.GetCurrentMethodName());
        }