public void EventsTab_CanExtend_Invoke_ReturnsTrue(object extendee) { var mockServiceProvider = new Mock <IServiceProvider>(MockBehavior.Strict); var tab = new EventsTab(mockServiceProvider.Object); Assert.True(tab.CanExtend(extendee)); }
public void EventsTab_GetDefaultProperty_Invoke_ReturnsExpected(object obj, IServiceProvider serviceProvider, object expected) { var tab = new EventsTab(serviceProvider); Assert.Same(expected, tab.GetDefaultProperty(obj)); // Call again to test caching behavior. Assert.Same(expected, tab.GetDefaultProperty(obj)); }
public void EventsTab_Ctor_IServiceProvider() { var mockServiceProvider = new Mock <IServiceProvider>(MockBehavior.Strict); var tab = new EventsTab(mockServiceProvider.Object); Assert.NotNull(tab.Bitmap); Assert.Null(tab.Components); Assert.Equal("Events", tab.HelpKeyword); Assert.Equal("Events", tab.TabName); }
private void btnEventDelete_Click(object sender, EventArgs e) { if (EventsTab.DeleteEvent( tbNewEventsNumber.Text.Trim(), numericUpDownEventAgeLimit.Text.Trim(), tbNewEventsName.Text.Trim(), comboBoxEventsSex.Text.Trim())) { LoadEventList(); } }
private void btnEventEdit_Click(object sender, EventArgs e) { if (EventsTab.AddEvent( tbNewEventsNumber.Text.Trim(), numericUpDownEventAgeLimit.Text.Trim(), tbNewEventsName.Text.Trim(), comboBoxEventsSex.Text.Trim(), editMode: true)) { LoadEventList(); } }
private void btnAddEvent_Click(object sender, EventArgs e) { if (EventsTab.AddEvent(tbNewEventsNumber.Text.Trim(), numericUpDownEventAgeLimit.Text.Trim(), tbNewEventsName.Text.Trim(), comboBoxEventsSex.Text.Trim())) { statusViewer.Update("Event added !", Status.SUCCESS); LoadEventList(); ClearEventsTab(); } }
public void EventsTab_GetDefaultProperty_IDesignerEventService_Success(object obj, ActiveDesignerEventArgs e, object expected) { using var service = new CustomDesignerEventService(); var mockServiceProvider = new Mock <IServiceProvider>(MockBehavior.Strict); mockServiceProvider .Setup(p => p.GetService(typeof(IDesignerEventService))) .Returns(service); var tab = new EventsTab(mockServiceProvider.Object); Assert.Null(tab.GetDefaultProperty(obj)); service.OnActiveDesignerChanged(e); Assert.Equal(expected, tab.GetDefaultProperty(obj)); }
private void EventSearchClick(object sender, EventArgs e) { Event searchedEvent = EventsTab.SearchEvent( tbNewEventsNumber.Text, numericUpDownEventAgeLimit.Text, tbNewEventsName.Text, comboBoxEventsSex.Text); if (searchedEvent != null) { tbNewEventsNumber.Text = searchedEvent.Number; tbNewEventsName.Text = searchedEvent.Name; comboBoxEventsSex.Text = searchedEvent.Gender; numericUpDownEventAgeLimit.Text = searchedEvent.AgeLimit.ToString(); } }