private ListBox SetUpListBoxForTest(string[] names) { CollectionNameEditor_Accessor target = new CollectionNameEditor_Accessor(); MongoDatabase database = Mock.Create<MongoDatabase>(Constructor.Mocked); Mock.Arrange(() => database.GetCollectionNames()).Returns(names); return target.BuildListBox(database); }
public void GetEditStyleTest() { CollectionNameEditor_Accessor target = new CollectionNameEditor_Accessor(); Assert.AreEqual(UITypeEditorEditStyle.DropDown, target.GetEditStyle(null)); }
public void OnListBoxSelectedValueChangedTest() { CollectionNameEditor_Accessor target = new CollectionNameEditor_Accessor(); IWindowsFormsEditorService serviceMock = Mock.Create<IWindowsFormsEditorService>(); target.edSvc = serviceMock; Mock.Arrange(() => serviceMock.CloseDropDown()).OccursOnce(); target.OnListBoxSelectedValueChanged(null, null); Mock.Assert(serviceMock); }