public void Validate_MessageMatchTheFiltersForLessOrEqualPatternWithWrongData_ReturnException() { var notificationFiltersValidator = new NotificationFiltersValidator(); var message = new FieldsContainer(); message.Add("Message", "text110"); var filters = new Filters { FilterParams = new[] { new FilterInfo { ColumnName = "Message", Patterns = new[] { "110" }, MatchPatternOperator = "<=" } } }; notificationFiltersValidator.SetFilters(filters); Action result = () => notificationFiltersValidator.Validate(message); result.Should().Throw <FormatException>().WithMessage("Nieprawidłowy format ciągu wejściowego."); }
private void CreateSubfieldsView(SerializedProperty serializedProperty) { var value = GetTargetObjectValue(); if (value == null) { FieldsContainer.Add(FieldUtility.NoneLabel); return; } var subInfos = value.GetType().GetSerializedFieldsUpToBase(); for (int i = 0; i < subInfos.Length; i++) { var subProp = subInfos[i]; var property = serializedProperty.FindPropertyRelative(subProp.Name); var subField = new PropertyFieldElement(); subField.HideUnsupported = HideUnsupported; subField.SetProperty(property); if (HideUnsupported && subField.SubfieldsCount == 0) { continue; } AddSubfield(subField); } }
protected override void CreateVisualElements(SerializedProperty property) { var button = new Button(EditClicked); button.text = "Edit"; FieldsContainer.Add(button); }
public void Fields_GetFields_ReturnFieldsList() { var fieldsContainer = new FieldsContainer(); fieldsContainer.Add(FieldName, Value); fieldsContainer.Fields.Should().BeEquivalentTo(_expected); }
private void GetColumnsByColumnsNames(dynamic columns) { foreach (var f in columns) { if (Array.Exists(_params.ColumnsNames, s => s.Equals(f.Key))) { _container.Add(f.Key, value: f.Value?.ToString() ?? string.Empty); } } }
public void Clear_ClearList_ReturnEmptyList() { var fieldsContainer = new FieldsContainer(); fieldsContainer.Add(FieldName, Value); fieldsContainer.Clear(); fieldsContainer.Fields.Should().BeEmpty(); }
public void Init() { _fieldsContainer = new FieldsContainer(); _fieldsContainer.Add(FieldName, Value); _expected = new List <FieldInfo> { new FieldInfo { Name = FieldName, Value = Value } }; }
public void Validate_MessageMatchTheFiltersForDefaultPattern_ReturnTrue() { var notificationFiltersValidator = new NotificationFiltersValidator(); var message = new FieldsContainer(); message.Add("Message", "Critical"); notificationFiltersValidator.SetFilters(_filters); notificationFiltersValidator.Validate(message).Should().BeTrue(); }
protected override void CreateVisualElements(SerializedProperty property) { _currentNameLabel = new Label("None"); _currentNameLabel.AddToClassList("bb-name-dropdown"); FieldsContainer.Add(_currentNameLabel); UpdateNames(property); var currentName = property.FindPropertyRelative("_name").stringValue; SetNewName(currentName); var manipulator = new ContextualMenuManipulator(PopulateContextMenu); _currentNameLabel.AddManipulator(manipulator); }
private void CreateSimpleView(SerializedProperty property) { var simpleField = FieldUtility.GetFieldByType(property, GetTargetObjectValue(), SimpleValueChanged); simpleField.AddToClassList("simple-prop-value"); var simpleContainer = new VisualElement(); simpleContainer.AddToClassList("simple-prop-container"); if (!Unwrap) { simpleContainer.Add(Label); } simpleContainer.Add(simpleField); FieldsContainer.Add(simpleContainer); }
public void Replace_ReplaceFields_ReturnReplacedFieldsList() { var fieldsContainer = new FieldsContainer(); fieldsContainer.Add(FieldName, Value); var expected = new List <FieldInfo> { new FieldInfo { Name = "Exception", Value = "Critical" } }; fieldsContainer.Replace(expected); fieldsContainer.Fields.Should().BeEquivalentTo(expected); }
public void Init() { _aggregator = new Aggregators { AggregationParams = new[] { new AggregationInfo { MessageAggregateColumnNames = new[] { "Message", "MessageType", "Exception" } } } }; _message = new FieldsContainer(); _message.Add("Message", "Exception"); }
public void Validate_MessageMatchTheFiltersForLessOrEqualPattern_ReturnTrue() { var notificationFiltersValidator = new NotificationFiltersValidator(); var message = new FieldsContainer(); message.Add("Message", "110"); var filters = new Filters { FilterParams = new[] { new FilterInfo { ColumnName = "Message", Patterns = new[] { "110" }, MatchPatternOperator = "<=" } } }; notificationFiltersValidator.SetFilters(filters); notificationFiltersValidator.Validate(message).Should().BeTrue(); }