public void TestConstructor_SetsPublishCommand()
        {
            var objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);

            Assert.AreEqual(
                ((ChoiceStepContent)objectUnderTest.Content).ViewModel.PublishCommand,
                objectUnderTest.PublishCommand);
        }
コード例 #2
0
        public void TestConstructor_NavigatesToPreviousChoice()
        {
            PackageMock.Setup(
                p => p.GetMefService <IVsProjectPropertyService>()
                .GetUserProperty(It.IsAny <Project>(), ChoiceStepViewModel.GoogleCloudPublishChoicePropertyName))
            .Returns(ChoiceType.Gke.ToString);

            var objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);

            Assert.IsInstanceOfType(objectUnderTest.Content, typeof(GkeStepContent));
        }
        protected override void BeforeEach()
        {
            _mockedCloseWindowAction = Mock.Of <Action>();
            _mockedParsedProject     = Mock.Of <IParsedDteProject>(p => p.Project == Mock.Of <Project>());
            _changedProperties       = new List <string>();

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

            _objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);
            _objectUnderTest.PropertyChanged += (sender, args) => _changedProperties.Add(args.PropertyName);

            _stepContentMock = new Mock <FrameworkElement>().As <IStepContent <IPublishDialogStep> >();
            _stepContentMock.DefaultValueProvider = DefaultValueProvider.Mock;
        }
コード例 #4
0
        public void BeforeEach()
        {
            _stepContentMock =
                new Mock <IStepContent <IPublishDialogStep> > {
                DefaultValueProvider = DefaultValueProvider.Mock
            };

            _mockedCloseWindowAction = Mock.Of <Action>();
            _mockedParsedProject     = Mock.Of <IParsedDteProject>(p => p.Project == Mock.Of <Project>());


            _objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);

            _changedProperties = new List <string>();
            _objectUnderTest.PropertyChanged += (sender, args) => _changedProperties.Add(args.PropertyName);
        }
コード例 #5
0
        public void TestConstructor_SetsContent()
        {
            var objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);

            Assert.IsInstanceOfType(objectUnderTest.Content, typeof(ChoiceStepContent));
        }
コード例 #6
0
        public void TestConstructor_SetsPreviousCommand()
        {
            var objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);

            Assert.IsFalse(objectUnderTest.PrevCommand.CanExecuteCommand);
        }
コード例 #7
0
        public void TestConstructor_SetsProject()
        {
            var objectUnderTest = new PublishDialogWindowViewModel(_mockedParsedProject, _mockedCloseWindowAction);

            Assert.AreEqual(_mockedParsedProject, objectUnderTest.Project);
        }