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);
        }
Пример #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);
        }