Skip to content

Commit eedb6c8

Browse files
committed
fixed issue #115 - added selector as parameter for Not
1 parent e9291aa commit eedb6c8

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎src/Incoding.UnitTest/MvcContribGroup/Incoding Meta Language/Selector/When_jquery_selector_tree_traversal.cs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
#region << Using >>
44

5+
using Incoding.Extensions;
56
using Incoding.MvcContrib;
67
using Machine.Specifications;
78

@@ -143,6 +144,11 @@ public class When_jquery_selector_tree_traversal
143144
.ToString()
144145
.ShouldEqual("$('*').not('p')");
145146

147+
It should_be_not_by_selector = () => Selector.Jquery.All()
148+
.Not("Id".ToId())
149+
.ToString()
150+
.ShouldEqual("$('*').not('#Id')");
151+
146152
It should_be_not_by_expression = () => Selector.Jquery.All()
147153
.Not(JqueryExpression.Button)
148154
.ToString()

‎src/Incoding/MvcContrib/Incoding Meta Language/Selectors/Jquery/JquerySelectorExtendTreeTraversalExtensions.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ public static JquerySelectorExtend Not(this JquerySelectorExtend original, Jquer
351351
return original.Not(r => r.Expression(expression));
352352
}
353353

354+
/// <summary>
355+
/// Selects all elements that do not match the given <paramref name="selector" />.
356+
/// </summary>
357+
public static JquerySelectorExtend Not(this JquerySelectorExtend original, JquerySelectorExtend selector)
358+
{
359+
return AddTree(original, jquerySelector => selector, "not");
360+
}
361+
354362
/// <summary>
355363
/// Selects all elements that do not match the given <paramref name="action" />.
356364
/// </summary>

0 commit comments

Comments
 (0)