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)); }
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(); }