public void OrCondTest() { List <Message> messages = InitMessages(); var filterObj = new MsgFilterObj() { Messages = messages, User = "******", MessageText = "H", StartTime = null, EndTime = null, UseAndForCond = false }; IEnumerable <Message> act_msgs = MsgFilter.ApplyFilter(filterObj); bool isSequenceEqual = Enumerable.SequenceEqual(messages, act_msgs); Assert.IsTrue(isSequenceEqual); }
public void AndCondTest() { List <Message> messages = InitMessages(); var filterObj = new MsgFilterObj() { Messages = messages, User = "******", MessageText = "H", StartTime = now, EndTime = now, UseAndForCond = true }; IEnumerable <Message> exp_msgs = new List <Message> { messages[0], messages[1] }; IEnumerable <Message> act_msgs = MsgFilter.ApplyFilter(filterObj); bool isSequenceEqual = Enumerable.SequenceEqual(exp_msgs, act_msgs); Assert.IsTrue(isSequenceEqual); }
private void RefreshMessagesView() { var filterObj = new MsgFilterObj() { Messages = Mobile.MessageStorage.GetMessages().ToList(), User = UsersComboBox.SelectedItem as string, MessageText = MsgSearchTextBox.Text, StartTime = null, EndTime = null, UseAndForCond = UseAndCheckBox.Checked }; if (MsgStartDateTime.Checked) { filterObj.StartTime = MsgStartDateTime.Value; } if (MsgEndDateTime.Checked) { filterObj.EndTime = MsgEndDateTime.Value; } ShowMessages(MsgFilter.ApplyFilter(filterObj)); }