RunPsTestWorkflow() public méthode

public RunPsTestWorkflow ( Func scriptBuilder, Action initialize, System.Action cleanup, string callingClassType, string mockName ) : void
scriptBuilder Func
initialize Action
cleanup System.Action
callingClassType string
mockName string
Résultat void
        public void Init()
        {
            if (_resourceGroupName != null)
            {
                return;
            }

            _synchronizationContext = SynchronizationContext.Current;

            _controller = DevTestLabsController.NewInstance;

            var callingClassType = TestUtilities.GetCallingClass(1);
            var mockName = TestUtilities.GetCurrentMethodName(1);

            _controller.RunPsTestWorkflow(
                () => new[] { "Setup-Test-ResourceGroup " + _resourceGroupName + " " + _labName },

                // custom initializer
                (factory) =>
                {
                    _resourceGroupName = GenerateName();
                    _labName = GenerateName();
                },

                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
Exemple #2
0
        public void Init()
        {
            if (_resourceGroupName != null)
            {
                return;
            }

            _synchronizationContext = SynchronizationContext.Current;

            _controller = DevTestLabsController.NewInstance;

            var callingClassType = TestUtilities.GetCallingClass(1);
            var mockName         = TestUtilities.GetCurrentMethodName(1);

            _controller.RunPsTestWorkflow(
                () => new[] { "Setup-Test-ResourceGroup " + _resourceGroupName + " " + _labName },

                // custom initializer
                (factory) =>
            {
                _resourceGroupName = GenerateName();
                _labName           = GenerateName();
            },

                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }
        public void Init()
        {
            if (_resourceGroupName != null)
            {
                return;
            }

            _synchronizationContext = SynchronizationContext.Current;

            _controller = DevTestLabsController.NewInstance;

            var sf = new StackTrace().GetFrame(1);
            var callingClassType = sf.GetMethod().ReflectedType?.ToString();
            var mockName         = sf.GetMethod().Name;

            _controller.RunPsTestWorkflow(
                () => new[] { "Setup-Test-ResourceGroup " + _resourceGroupName + " " + _labName },
                // custom initializer
                () =>
            {
                _resourceGroupName = GenerateName();
                _labName           = GenerateName();
            },
                // no custom cleanup
                null,
                callingClassType,
                mockName);
        }