public void UnknownPropertyKey_ShouldDoNothing() { ICommand cmd = new RemovePropertyByKeyCommand(_file, "UnknownKey"); cmd.Execute(); Assert.Equal(2, _file.GetProperties().Count()); }
private bool GetValueAlreadyExists() => _file.GetProperties().Any(p => p.Value == _propertyToAdd.Value);
private void RemoveAllPropertiesByKey() { var props = _file.GetProperties().Where(p => p.Key != _targetKey); _file.SetProperties(props); }
private void RemoveComments() { var p = _file.GetProperties().Where(prop => !prop.IsComment()); _file.SetProperties(p); }
private void RemoveEmptyLines() { var p = _file.GetProperties().Where(prop => !prop.IsEmptyLine()); _file.SetProperties(p); }