public void Filter(string columName, string[] values) { string filter = $"[{columName}] IN ({values.Select(x => $"'{x}'").Joined()})"; _filterClause.TryClearColumn(columName); _filterClause.AddFilterClause(filter); MagicToolbox.SetProperty(_view, nameof(_view.FilterString), _filterClause.Clause); }
public void GetEvent_EventWithoutHandlers_ReturnNull() { // Arrange var anyClass = new AnyClass(); // Act var evt = MagicToolbox.GetEvent(anyClass, nameof(AnyClass.Event)); // Assert evt.Should().BeNull(); }
public void GetEvent_EventWithHandlers_InvokeEventHandlerByReflection() { // Arrange var anyClass = new AnyClass(); var receivedSender = default(object); var receivedEventArgs = default(EventArgs); var anyEventArgs = EventArgs.Empty; anyClass.Event += (sender, e) => { receivedSender = sender; receivedEventArgs = e; }; // Act var evt = MagicToolbox.GetEvent(anyClass, nameof(AnyClass.Event)); evt.Invoke(this, anyEventArgs); // Assert receivedSender.Should().BeEquivalentTo(this); receivedEventArgs.Should().BeEquivalentTo(anyEventArgs); }
public void CleanFilter(string headerName) { _filterClause.ClearColumn(headerName); MagicToolbox.SetProperty(_view, nameof(_view.FilterString), _filterClause.Clause); }