public void EditValue_WithCurrentItemInAvailableItems_ReturnsCurrentItem() { // Setup var foreshoreProfile = new TestForeshoreProfile(); var properties = new ObjectPropertiesWithForeshoreProfile(foreshoreProfile, new[] { foreshoreProfile }); var propertyBag = new DynamicPropertyBag(properties); var editor = new ForeshoreProfileEditor(); var someValue = new object(); var serviceProvider = mockRepository.Stub <IServiceProvider>(); var service = mockRepository.Stub <IWindowsFormsEditorService>(); var descriptorContext = mockRepository.Stub <ITypeDescriptorContext>(); serviceProvider.Stub(p => p.GetService(null)).IgnoreArguments().Return(service); descriptorContext.Stub(c => c.Instance).Return(propertyBag); mockRepository.ReplayAll(); // Call object result = editor.EditValue(descriptorContext, serviceProvider, someValue); // Assert Assert.AreSame(foreshoreProfile, result); mockRepository.VerifyAll(); }
public void DefaultConstructor_ReturnsNewInstance() { // Call var editor = new ForeshoreProfileEditor(); // Assert Assert.IsInstanceOf <SelectionEditor <IHasForeshoreProfileProperty, ForeshoreProfile> >(editor); }