/// <summary>
 /// Creates a GKE step complete with behavior and visuals.
 /// </summary>
 public GkeStepContent(
     IPublishDialog publishDialog,
     IGkeDataSource dataSource        = null,
     IApiManager apiManager           = null,
     Func <Project> pickProjectPrompt = null) : this()
 {
     ViewModel = new GkeStepViewModel(dataSource, apiManager, pickProjectPrompt, publishDialog);
 }
 /// <summary>
 /// Creates a new step instance. This method will also create the necessary view and conect both
 /// objects together.
 /// </summary>
 public FlexStepContent(
     IPublishDialog publishDialog,
     IGaeDataSource dataSource = null,
     Func <Task <bool> > setAppRegionAsyncFunc = null) : this()
 {
     ViewModel = new FlexStepViewModel(
         dataSource, setAppRegionAsyncFunc, publishDialog);
 }
 public TestPublishDialogStep(
     IApiManager apiManager,
     Func <GcpProject> pickProjectPrompt,
     IPublishDialog publishDialog) : base(
         apiManager, pickProjectPrompt,
         publishDialog)
 {
     PublishCommand = Mock.Of <IProtectedCommand>();
 }
Exemple #4
0
 public GceStepContent(
     IPublishDialog publishDialog,
     IGceDataSource dataSource = null,
     IWindowsCredentialsStore currentWindowsCredentialStore = null,
     Action <Instance> manageCredentialsPrompt = null) : this()
 {
     ViewModel = new GceStepViewModel(
         dataSource, currentWindowsCredentialStore, manageCredentialsPrompt, publishDialog);
 }
Exemple #5
0
 public CoreGceWarningStepViewModel(IPublishDialog publishDialog)
 {
     _publishDialog               = publishDialog;
     BrowseAspNetCoreIisDocs      = new ProtectedCommand(OnBrowseAspNetCoreIisDocs);
     BrowseAspNetMarketplaceImage = new ProtectedCommand(OnBrowseAspNeMarketplaceImage);
     Title            = string.Format(Resources.GcePublishStepTitle, publishDialog.Project.Name);
     ActionCommand    = new ProtectedCommand(OnNextCommand);
     _nextStepContent = new GceStepContent(_publishDialog);
     _browserService  = GoogleCloudExtensionPackage.Instance.GetMefServiceLazy <IBrowserService>();
 }
 /// <summary>
 /// Creates a new step instance. This method will also create the necessary view and conect both
 /// objects together.
 /// </summary>
 public FlexStepContent(
     IPublishDialog publishDialog,
     IGaeDataSource dataSource                 = null,
     IApiManager apiManager                    = null,
     Func <Project> pickProjectPrompt          = null,
     Func <Task <bool> > setAppRegionAsyncFunc = null) : this()
 {
     ViewModel = new FlexStepViewModel(
         dataSource, apiManager, pickProjectPrompt, setAppRegionAsyncFunc, publishDialog);
 }
Exemple #7
0
        public override void OnPushedToDialog(IPublishDialog dialog)
        {
            _publishDialog = dialog;

            DeploymentName    = _publishDialog.Project.Name.ToLower();
            DeploymentVersion = GetDefaultVersion();

            // Mark that the dialog is going to be busy until we have loaded the data.
            _publishDialog.TrackTask(Clusters.ValueTask);
        }
Exemple #8
0
 public GceStepContent(
     IPublishDialog publishDialog,
     IGceDataSource dataSource = null,
     IApiManager apiManager    = null,
     Func <Google.Apis.CloudResourceManager.v1.Data.Project> pickProjectPrompt = null,
     IWindowsCredentialsStore currentWindowsCredentialStore = null,
     Action <Instance> manageCredentialsPrompt = null) : this()
 {
     ViewModel = new GceStepViewModel(
         dataSource, apiManager, pickProjectPrompt,
         currentWindowsCredentialStore, manageCredentialsPrompt, publishDialog);
 }
        protected override void BeforeEach()
        {
            _parsedProject = new FakeParsedProject
            {
                Name        = VisualStudioProjectName,
                ProjectType = KnownProjectTypes.WebApplication
            };
            _mockedPublishDialog = Mock.Of <IPublishDialog>(pd => pd.Project == _parsedProject);

            _propertyServiceMock = new Mock <IVsProjectPropertyService>();
            PackageMock.Setup(p => p.GetMefService <IVsProjectPropertyService>()).Returns(_propertyServiceMock.Object);

            _objectUnderTest = new ChoiceStepViewModel(_mockedPublishDialog);
        }
        protected override void BeforeEach()
        {
            _validateGCloudSource = new TaskCompletionSource <GCloudValidationResult>();
            GCloudWrapperUtils.ValidateGCloudAsyncOverride =
                Mock.Of <Func <GCloudComponent, Task <GCloudValidationResult> > >(
                    f => f(It.IsAny <GCloudComponent>()) == _validateGCloudSource.Task);

            _propertyServiceMock = new Mock <IVsProjectPropertyService>();

            _appEngineDeploymentMock = new Mock <IAppEngineFlexDeployment>();
            _publishSource           = new TaskCompletionSource <object>();
            _appEngineDeploymentMock.Setup(
                d => d.PublishProjectAsync(
                    It.IsAny <IParsedProject>(), It.IsAny <AppEngineFlexDeployment.DeploymentOptions>()))
            .Returns(() => _publishSource.Task);
            _appEngineConfigurationMock = new Mock <IAppEngineConfiguration>();

            PackageMock.Setup(p => p.GetMefService <IVsProjectPropertyService>()).Returns(_propertyServiceMock.Object);
            PackageMock.Setup(p => p.GetMefServiceLazy <IAppEngineFlexDeployment>())
            .Returns(_appEngineDeploymentMock.ToLazy());
            PackageMock.Setup(p => p.GetMefServiceLazy <IAppEngineConfiguration>())
            .Returns(_appEngineConfigurationMock.ToLazy());

            _mockedProject       = Mock.Of <DteProject>(p => p.ConfigurationManager.ConfigurationRowNames == new string[0]);
            _mockedPublishDialog = Mock.Of <IPublishDialog>(
                pd => pd.Project.Name == VisualStudioProjectName && pd.Project.Project == _mockedProject);

            _trackedTask = null;
            Mock.Get(_mockedPublishDialog).Setup(pd => pd.TrackTask(It.IsAny <Task>()))
            .Callback((Task t) => _trackedTask = t);

            var mockedApiManager = Mock.Of <IApiManager>(
                m => m.AreServicesEnabledAsync(It.IsAny <IList <string> >()) == Task.FromResult(true));

            _gaeDataSourceMock        = new Mock <IGaeDataSource>();
            _getApplicationTaskSource = new TaskCompletionSource <Application>();
            _gaeDataSourceMock.Setup(x => x.GetApplicationAsync()).Returns(() => _getApplicationTaskSource.Task);

            _setAppRegionAsyncFuncMock = new Mock <Func <Task <bool> > >();
            _setAppRegionTaskSource    = new TaskCompletionSource <bool>();
            _setAppRegionAsyncFuncMock.Setup(func => func()).Returns(() => _setAppRegionTaskSource.Task);

            _objectUnderTest = new FlexStepViewModel(
                _gaeDataSourceMock.Object, mockedApiManager, Mock.Of <Func <GcpProject> >(),
                _setAppRegionAsyncFuncMock.Object, _mockedPublishDialog);
            _propertiesChanges = new List <string>();
            _objectUnderTest.PropertyChanged += (sender, args) => _propertiesChanges.Add(args.PropertyName);
        }
Exemple #11
0
 public override void OnPushedToDialog(IPublishDialog dialog)
 {
     _publishDialog = dialog;
 }
 public override void OnPushedToDialog(IPublishDialog dialog)
 {
     base.OnPushedToDialog(dialog);
     LoadingProjectTask = InitializeDialogState();
 }
 public void BeforeEach()
 {
     GoogleCloudExtensionPackage.Instance = Mock.Of <IGoogleCloudExtensionPackage>();
     _publishDialog = Mock.Of <IPublishDialog>(pd => pd.Project.Name == "SomeVsProjectName");
 }
 public virtual void OnPushedToDialog(IPublishDialog dialog)
 { }
Exemple #15
0
 public TestPublishDialogStep(IPublishDialog publishDialog) : base(publishDialog)
 {
     PublishCommandAsync = new Mock <ProtectedAsyncCommand>(Mock.Of <Func <Task> >(), false).Object;
 }
 public override void OnPushedToDialog(IPublishDialog dialog)
 {
     _publishDialog = dialog;
 }
 public CoreGceWarningStepContent(IPublishDialog publishDialog)
 {
     InitializeComponent();
     DataContext = ViewModel = new CoreGceWarningStepViewModel(publishDialog);
 }
        public override void OnPushedToDialog(IPublishDialog dialog)
        {
            _dialog = dialog;

            Choices = GetChoicesForCurrentProject();
        }
        public override void OnPushedToDialog(IPublishDialog dialog)
        {
            base.OnPushedToDialog(dialog);

            InitializeDialogState();
        }
        public override void OnPushedToDialog(IPublishDialog dialog)
        {
            _publishDialog = dialog;

            _publishDialog.TrackTask(Instances.ValueTask);
        }
 /// <summary>
 /// Creates a GKE step complete with behavior and visuals.
 /// </summary>
 public GkeStepContent(IPublishDialog publishDialog) : this()
 {
     ViewModel = new GkeStepViewModel(publishDialog);
 }
 public virtual void OnPushedToDialog(IPublishDialog dialog)
 {
 }
Exemple #23
0
        public override void OnPushedToDialog(IPublishDialog dialog)
        {
            _dialog = dialog;

            Choices = GetChoicesForCurrentProject();
        }