Exemple #1
0
        public void SameValueReturnedIfWindowsFormsServiceReturned()
        {
            mockServiceProvider.SetServiceToReturn(null);

            string oldValue = "Test";
            string newValue = (string)editor.EditValue(null, mockServiceProvider, oldValue);

            Assert.IsTrue(Object.ReferenceEquals(oldValue, newValue));
            Assert.AreEqual(typeof(IWindowsFormsEditorService),
                            mockServiceProvider.GetServiceRequested(1));
        }
Exemple #2
0
        public void SetUpFixture()
        {
            editor = new WixDropDownEditor();

            // Edit the value.
            mockServiceProvider           = new MockServiceProvider();
            mockWindowsFormsEditorService = new MockWindowsFormsEditorService();
            mockServiceProvider.SetServiceToReturn(mockWindowsFormsEditorService);
            expectedNewValue = "NewValue";
            mockWindowsFormsEditorService.SetNewValue(expectedNewValue);

            newValue = editor.EditValue(mockServiceProvider, "Test");

            expectedControlType = mockWindowsFormsEditorService.GetDropDownControlTypeUsed();
        }
        public void SetUpFixture()
        {
            editor = new GuidEditor();

            // Edit the guid value.
            mockServiceProvider           = new MockServiceProvider();
            mockWindowsFormsEditorService = new MockWindowsFormsEditorService();
            mockServiceProvider.SetServiceToReturn(mockWindowsFormsEditorService);
            expectedNewGuid = Guid.NewGuid().ToString().ToUpperInvariant();
            mockWindowsFormsEditorService.SetNewValue(expectedNewGuid);

            Guid guid = Guid.NewGuid();

            newValue = editor.EditValue(mockServiceProvider, guid.ToString().ToUpperInvariant());

            expectedGuidControlType = mockWindowsFormsEditorService.GetDropDownControlTypeUsed();
        }