[fizzler] 6 new revisions pushed by azizatif on 2013-01-18 18:04 GMT

6 views
Skip to first unread message

fiz...@googlecode.com

unread,
Jan 18, 2013, 1:05:06 PM1/18/13
to fizzler...@googlegroups.com
6 new revisions:

Revision: 4b45b7377352
Branch: default
Author: azizatif
Date: Thu Jan 17 15:28:40 2013
Log: HumanReadableSelectorGenerator.Text to auto-property
http://code.google.com/p/fizzler/source/detail?r=4b45b7377352

Revision: 492613d75fcf
Branch: default
Author: azizatif
Date: Thu Jan 17 15:41:05 2013
Log: Project/team-wide ReSharper settings
http://code.google.com/p/fizzler/source/detail?r=492613d75fcf

Revision: c35bd6c78d34
Branch: default
Author: azizatif
Date: Thu Jan 17 15:49:10 2013
Log: Tabs > spaces
http://code.google.com/p/fizzler/source/detail?r=c35bd6c78d34

Revision: 80f3ee0292c0
Branch: default
Author: azizatif
Date: Thu Jan 17 15:50:57 2013
Log: Deleting unused files
http://code.google.com/p/fizzler/source/detail?r=80f3ee0292c0

Revision: 76ba184b53c5
Branch: default
Author: azizatif
Date: Thu Jan 17 15:53:37 2013
Log: Removing UTF-8 BOM from source files
http://code.google.com/p/fizzler/source/detail?r=76ba184b53c5

Revision: 8fd9851b85e7
Branch: default
Author: azizatif
Date: Thu Jan 17 16:03:37 2013
Log: Ignoring Hg bundles
http://code.google.com/p/fizzler/source/detail?r=8fd9851b85e7

==============================================================================
Revision: 4b45b7377352
Branch: default
Author: azizatif
Date: Thu Jan 17 15:28:40 2013
Log: HumanReadableSelectorGenerator.Text to auto-property
http://code.google.com/p/fizzler/source/detail?r=4b45b7377352

Modified:
/Fizzler/HumanReadableSelectorGenerator.cs

=======================================
--- /Fizzler/HumanReadableSelectorGenerator.cs Wed Oct 6 16:35:37 2010
+++ /Fizzler/HumanReadableSelectorGenerator.cs Thu Jan 17 15:28:40 2013
@@ -9,7 +9,6 @@
public class HumanReadableSelectorGenerator : ISelectorGenerator
{
private int _chainCount;
- private string _text;

/// <summary>
/// Initializes the text.
@@ -22,11 +21,7 @@
/// <summary>
/// Gets the generated human-readable description text.
/// </summary>
- public string Text
- {
- get { return _text; }
- private set { _text = value; }
- }
+ public string Text { get; private set; }

/// <summary>
/// Generates human-readable for a selector in a group.

==============================================================================
Revision: 492613d75fcf
Branch: default
Author: azizatif
Date: Thu Jan 17 15:41:05 2013
Log: Project/team-wide ReSharper settings
http://code.google.com/p/fizzler/source/detail?r=492613d75fcf

Added:
/Fizzler.sln.DotSettings

=======================================
--- /dev/null
+++ /Fizzler.sln.DotSettings Thu Jan 17 15:41:05 2013
@@ -0,0 +1,2 @@
+<wpf:ResourceDictionary xml:space="preserve"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml"
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+ <s:String
x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RedundantCommaInArrayInitializer/@EntryIndexedValue">HINT</s:String></wpf:ResourceDictionary>

==============================================================================
Revision: c35bd6c78d34
Branch: default
Author: azizatif
Date: Thu Jan 17 15:49:10 2013
Log: Tabs > spaces
http://code.google.com/p/fizzler/source/detail?r=c35bd6c78d34

Modified:
/ConsoleFizzler/Program.cs
/Fizzler.Sandbox/Xml/XmlNodeExtensions.cs
/Fizzler.Sandbox/Xml/XmlNodeSelection.cs
/Fizzler.Tests/AttributeSelectors.cs
/Fizzler.Tests/ChildAndAdjacentSelectors.cs
/Fizzler.Tests/ClassSelector.cs
/Fizzler.Tests/ElementSelector.cs
/Fizzler.Tests/HumanReadableSelectorGeneratorTests.cs
/Fizzler.Tests/IDSelector.cs
/Fizzler.Tests/MultipleSelectors.cs
/Fizzler.Tests/NthChild.cs
/Fizzler.Tests/PsuedoSelectors.cs
/Fizzler.Tests/SelectorBaseTest.cs
/Fizzler.Tests/TokenTests.cs
/Fizzler.Tests/TokenerTests.cs
/Fizzler/IElementOps.cs
/Fizzler/Token.cs
/Fizzler/TokenKind.cs
/NET-2.0/ExtensionAttribute.cs

=======================================
--- /ConsoleFizzler/Program.cs Tue Feb 2 14:28:39 2010
+++ /ConsoleFizzler/Program.cs Thu Jan 17 15:49:10 2013
@@ -14,7 +14,7 @@
#endregion

internal static class Program
- {
+ {
internal static int Main(string[] args)
{
try
@@ -29,32 +29,32 @@
}
}

- static int Run(string[] args)
- {
- if (args.Length == 0)
+ static int Run(string[] args)
+ {
+ if (args.Length == 0)
throw new ApplicationException("Missing command.");

- var commands = new[]
+ var commands = new[]
{
- new CommandNames(() => new SelectCommand(),
Aliases("select", "sel")),
- new CommandNames(() => new ExplainCommand(),
Aliases("explain", "describe", "desc")),
- }
- .SelectMany(e => e.Value.Select(v => new KeyValuePair<string,
Func<ICommand>>(v, e.Key)))
- .ToDictionary(e => e.Key, e => e.Value);
+ new CommandNames(() => new SelectCommand(),
Aliases("select", "sel")),
+ new CommandNames(() => new ExplainCommand(),
Aliases("explain", "describe", "desc")),
+ }
+ .SelectMany(e => e.Value.Select(v => new KeyValuePair<string,
Func<ICommand>>(v, e.Key)))
+ .ToDictionary(e => e.Key, e => e.Value);

- var name = args[0];
-
+ var name = args[0];
+
Func<ICommand> command;
if (!commands.TryGetValue(name, out command))
throw new ApplicationException("Invalid command.");

- return command().Run(args.Skip(1).ToArray());
+ return command().Run(args.Skip(1).ToArray());

- }
+ }

static IEnumerable<string> Aliases(params string[] values)
{
return values;
}
- }
+ }
}
=======================================
--- /Fizzler.Sandbox/Xml/XmlNodeExtensions.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Sandbox/Xml/XmlNodeExtensions.cs Thu Jan 17 15:49:10 2013
@@ -11,110 +11,110 @@
#endregion

public static class XmlNodeExtensions
- {
- /// <summary>
- /// Determines whether this node is an element or not.
- /// </summary>
- public static bool IsElement(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return node.NodeType == XmlNodeType.Element;
- }
+ {
+ /// <summary>
+ /// Determines whether this node is an element or not.
+ /// </summary>
+ public static bool IsElement(this XmlNode node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return node.NodeType == XmlNodeType.Element;
+ }

- /// <summary>
- /// Returns a collection of elements from this collection.
- /// </summary>
- public static IEnumerable<XmlNode> Elements(this IEnumerable<XmlNode>
nodes)
- {
- if (nodes == null) throw new ArgumentNullException("nodes");
- return nodes.Where(n => n.IsElement());
- }
+ /// <summary>
+ /// Returns a collection of elements from this collection.
+ /// </summary>
+ public static IEnumerable<XmlNode> Elements(this
IEnumerable<XmlNode> nodes)
+ {
+ if (nodes == null) throw new ArgumentNullException("nodes");
+ return nodes.Where(n => n.IsElement());
+ }

- /// <summary>
- /// Returns a collection of child nodes of this node.
- /// </summary>
- public static IEnumerable<XmlNode> Children(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return node.ChildNodes.Cast<XmlNode>();
- }
+ /// <summary>
+ /// Returns a collection of child nodes of this node.
+ /// </summary>
+ public static IEnumerable<XmlNode> Children(this XmlNode node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return node.ChildNodes.Cast<XmlNode>();
+ }


- /// <summary>
- /// Returns a collection of child elements of this node.
- /// </summary>
- public static IEnumerable<XmlNode> Elements(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return node.Children().Elements();
- }
+ /// <summary>
+ /// Returns a collection of child elements of this node.
+ /// </summary>
+ public static IEnumerable<XmlNode> Elements(this XmlNode node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return node.Children().Elements();
+ }

- /// <summary>
- /// Returns a collection of the sibling elements after this node.
- /// </summary>
- public static IEnumerable<XmlNode> ElementsAfterSelf(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return node.NodesAfterSelf().Elements();
- }
+ /// <summary>
+ /// Returns a collection of the sibling elements after this node.
+ /// </summary>
+ public static IEnumerable<XmlNode> ElementsAfterSelf(this XmlNode
node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return node.NodesAfterSelf().Elements();
+ }

- /// <summary>
- /// Returns a collection of the sibling nodes after this node.
- /// </summary>
- public static IEnumerable<XmlNode> NodesAfterSelf(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return NodesAfterSelfImpl(node);
- }
+ /// <summary>
+ /// Returns a collection of the sibling nodes after this node.
+ /// </summary>
+ public static IEnumerable<XmlNode> NodesAfterSelf(this XmlNode
node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return NodesAfterSelfImpl(node);
+ }

- private static IEnumerable<XmlNode> NodesAfterSelfImpl(XmlNode node)
- {
- while ((node = node.NextSibling) != null)
- yield return node;
- }
+ private static IEnumerable<XmlNode> NodesAfterSelfImpl(XmlNode
node)
+ {
+ while ((node = node.NextSibling) != null)
+ yield return node;
+ }

- /// <summary>
- /// Returns a collection of the sibling elements before this node.
- /// </summary>
- public static IEnumerable<XmlNode> ElementsBeforeSelf(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return node.NodesBeforeSelf().Elements();
- }
+ /// <summary>
+ /// Returns a collection of the sibling elements before this node.
+ /// </summary>
+ public static IEnumerable<XmlNode> ElementsBeforeSelf(this XmlNode
node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return node.NodesBeforeSelf().Elements();
+ }

- /// <summary>
- /// Returns a collection of the sibling nodes before this node.
- /// </summary>
- public static IEnumerable<XmlNode> NodesBeforeSelf(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return NodesBeforeSelfImpl(node);
- }
+ /// <summary>
+ /// Returns a collection of the sibling nodes before this node.
+ /// </summary>
+ public static IEnumerable<XmlNode> NodesBeforeSelf(this XmlNode
node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return NodesBeforeSelfImpl(node);
+ }

- private static IEnumerable<XmlNode> NodesBeforeSelfImpl(XmlNode node)
- {
- while ((node = node.PreviousSibling) != null)
- yield return node;
- }
+ private static IEnumerable<XmlNode> NodesBeforeSelfImpl(XmlNode
node)
+ {
+ while ((node = node.PreviousSibling) != null)
+ yield return node;
+ }

- /// <summary>
- /// Returns a collection of all descendant nodes of this element.
- /// </summary>
- public static IEnumerable<XmlNode> Descendants(this XmlNode node)
- {
- if (node == null) throw new ArgumentNullException("node");
- return DescendantsImpl(node);
- }
+ /// <summary>
+ /// Returns a collection of all descendant nodes of this element.
+ /// </summary>
+ public static IEnumerable<XmlNode> Descendants(this XmlNode node)
+ {
+ if (node == null) throw new ArgumentNullException("node");
+ return DescendantsImpl(node);
+ }

- private static IEnumerable<XmlNode> DescendantsImpl(XmlNode node)
- {
- Debug.Assert(node != null);
- foreach (XmlNode child in node.ChildNodes)
- {
- yield return child;
- foreach (var descendant in child.Descendants())
- yield return descendant;
- }
- }
- }
+ private static IEnumerable<XmlNode> DescendantsImpl(XmlNode node)
+ {
+ Debug.Assert(node != null);
+ foreach (XmlNode child in node.ChildNodes)
+ {
+ yield return child;
+ foreach (var descendant in child.Descendants())
+ yield return descendant;
+ }
+ }
+ }
}
=======================================
--- /Fizzler.Sandbox/Xml/XmlNodeSelection.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Sandbox/Xml/XmlNodeSelection.cs Thu Jan 17 15:49:10 2013
@@ -9,26 +9,26 @@
#endregion

public static class XmlNodeSelection
- {
- /// <summary>
- /// Similar to <see cref="QuerySelectorAll" /> except it returns
- /// only the first element matching the supplied selector strings.
- /// </summary>
- public static XmlNode QuerySelector(this XmlNode node, string selector)
- {
- return node.QuerySelectorAll(selector).FirstOrDefault();
- }
+ {
+ /// <summary>
+ /// Similar to <see cref="QuerySelectorAll" /> except it returns
+ /// only the first element matching the supplied selector strings.
+ /// </summary>
+ public static XmlNode QuerySelector(this XmlNode node, string
selector)
+ {
+ return node.QuerySelectorAll(selector).FirstOrDefault();
+ }

- /// <summary>
- /// Retrieves all element nodes from descendants of the starting
- /// element node that match any selector within the supplied
- /// selector strings.
- /// </summary>
- public static IEnumerable<XmlNode> QuerySelectorAll(this XmlNode node,
string selector)
- {
- var generator = new SelectorGenerator<XmlNode>(new XmlNodeOps());
- Parser.Parse(selector, generator);
- return generator.Selector(Enumerable.Repeat(node, 1));
- }
- }
+ /// <summary>
+ /// Retrieves all element nodes from descendants of the starting
+ /// element node that match any selector within the supplied
+ /// selector strings.
+ /// </summary>
+ public static IEnumerable<XmlNode> QuerySelectorAll(this XmlNode
node, string selector)
+ {
+ var generator = new SelectorGenerator<XmlNode>(new
XmlNodeOps());
+ Parser.Parse(selector, generator);
+ return generator.Selector(Enumerable.Repeat(node, 1));
+ }
+ }
}
=======================================
--- /Fizzler.Tests/AttributeSelectors.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/AttributeSelectors.cs Thu Jan 17 15:49:10 2013
@@ -3,36 +3,36 @@
using NUnit.Framework;

[TestFixture]
- public class AttributeSelectors : SelectorBaseTest
- {
- [Test]
- public void Element_Attr_Exists()
- {
- var results = SelectList("div[id]");
-
- Assert.AreEqual(2, results.Count);
- Assert.AreEqual("div", results[0].Name);
- Assert.AreEqual("div", results[1].Name);
- }
+ public class AttributeSelectors : SelectorBaseTest
+ {
+ [Test]
+ public void Element_Attr_Exists()
+ {
+ var results = SelectList("div[id]");
+
+ Assert.AreEqual(2, results.Count);
+ Assert.AreEqual("div", results[0].Name);
+ Assert.AreEqual("div", results[1].Name);
+ }

- [Test]
- public void Element_Attr_Equals_With_Double_Quotes()
- {
- var results = SelectList("div[id=\"someOtherDiv\"]");
+ [Test]
+ public void Element_Attr_Equals_With_Double_Quotes()
+ {
+ var results = SelectList("div[id=\"someOtherDiv\"]");

- Assert.AreEqual(1, results.Count);
- Assert.AreEqual("div", results[0].Name);
- }
+ Assert.AreEqual(1, results.Count);
+ Assert.AreEqual("div", results[0].Name);
+ }

- [Test]
- public void Element_Attr_Space_Separated_With_Double_Quotes()
- {
- var results = SelectList("p[class~=\"ohyeah\"]");
+ [Test]
+ public void Element_Attr_Space_Separated_With_Double_Quotes()
+ {
+ var results = SelectList("p[class~=\"ohyeah\"]");

- Assert.AreEqual(1, results.Count);
- Assert.AreEqual("p", results[0].Name);
+ Assert.AreEqual(1, results.Count);
+ Assert.AreEqual("p", results[0].Name);
Assert.AreEqual("eeeee", results[0].InnerText);
- }
+ }

[Test]
public void Element_Attr_Space_Separated_With_Empty_Value()
@@ -41,14 +41,14 @@
}

[Test]
- public void Element_Attr_Hyphen_Separated_With_Double_Quotes()
- {
- var results = SelectList("span[class|=\"separated\"]");
+ public void Element_Attr_Hyphen_Separated_With_Double_Quotes()
+ {
+ var results = SelectList("span[class|=\"separated\"]");

- Assert.AreEqual(1, results.Count);
- Assert.AreEqual("span", results[0].Name);
+ Assert.AreEqual(1, results.Count);
+ Assert.AreEqual("span", results[0].Name);
Assert.AreEqual("test", results[0].InnerText);
- }
+ }

[Test]
public void Implicit_Star_Attr_Exact_With_Double_Quotes()
=======================================
--- /Fizzler.Tests/ChildAndAdjacentSelectors.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/ChildAndAdjacentSelectors.cs Thu Jan 17 15:49:10 2013
@@ -3,88 +3,88 @@
using NUnit.Framework;

[TestFixture]
- public class ChildAndAdjacentSelectors : SelectorBaseTest
- {
- [Test]
- public void Child_With_Pre_And_Post_Space()
- {
- Assert.AreEqual(2, SelectList("div > p").Count);
- }
+ public class ChildAndAdjacentSelectors : SelectorBaseTest
+ {
+ [Test]
+ public void Child_With_Pre_And_Post_Space()
+ {
+ Assert.AreEqual(2, SelectList("div > p").Count);
+ }

- [Test]
- public void Child_With_Post_Space()
- {
- Assert.AreEqual(2, SelectList("div> p").Count);
- }
+ [Test]
+ public void Child_With_Post_Space()
+ {
+ Assert.AreEqual(2, SelectList("div> p").Count);
+ }

- [Test]
- public void Child_With_Pre_Space()
- {
- Assert.AreEqual(2, SelectList("div >p").Count);
- }
+ [Test]
+ public void Child_With_Pre_Space()
+ {
+ Assert.AreEqual(2, SelectList("div >p").Count);
+ }

- [Test]
- public void Child_With_No_Space()
- {
- Assert.AreEqual(2, SelectList("div>p").Count);
- }
+ [Test]
+ public void Child_With_No_Space()
+ {
+ Assert.AreEqual(2, SelectList("div>p").Count);
+ }

- [Test]
- public void Child_With_Class()
- {
- Assert.AreEqual(1, SelectList("div > p.ohyeah").Count);
- }
+ [Test]
+ public void Child_With_Class()
+ {
+ Assert.AreEqual(1, SelectList("div > p.ohyeah").Count);
+ }

- [Test]
- public void All_Children()
- {
- // match <a href="">hi</a><span>test</span> so that's 3
- Assert.AreEqual(3, SelectList("p > *").Count);
- }
+ [Test]
+ public void All_Children()
+ {
+ // match <a href="">hi</a><span>test</span> so that's 3
+ Assert.AreEqual(3, SelectList("p > *").Count);
+ }

- [Test]
- public void All_GrandChildren()
- {
- // match <a href="">hi</a><span>test</span> so that's 3
- // *any* second level children under any div
- Assert.AreEqual(3, SelectList("div > * > *").Count);
- }
+ [Test]
+ public void All_GrandChildren()
+ {
+ // match <a href="">hi</a><span>test</span> so that's 3
+ // *any* second level children under any div
+ Assert.AreEqual(3, SelectList("div > * > *").Count);
+ }

- [Test]
- public void Adjacent_With_Pre_And_Post_Space()
- {
- Assert.AreEqual(1, SelectList("a + span").Count);
- }
+ [Test]
+ public void Adjacent_With_Pre_And_Post_Space()
+ {
+ Assert.AreEqual(1, SelectList("a + span").Count);
+ }

- [Test]
- public void Adjacent_With_Post_Space()
- {
- Assert.AreEqual(1, SelectList("a+ span").Count);
- }
+ [Test]
+ public void Adjacent_With_Post_Space()
+ {
+ Assert.AreEqual(1, SelectList("a+ span").Count);
+ }

- [Test]
- public void Adjacent_With_Pre_Space()
- {
- Assert.AreEqual(1, SelectList("a +span").Count);
- }
+ [Test]
+ public void Adjacent_With_Pre_Space()
+ {
+ Assert.AreEqual(1, SelectList("a +span").Count);
+ }

- [Test]
- public void Adjacent_With_No_Space()
- {
- Assert.AreEqual(1, SelectList("a+span").Count);
- }
+ [Test]
+ public void Adjacent_With_No_Space()
+ {
+ Assert.AreEqual(1, SelectList("a+span").Count);
+ }

- [Test]
- public void Comma_Child_And_Adjacent()
- {
- Assert.AreEqual(3, SelectList("a + span, div > p").Count);
- }
+ [Test]
+ public void Comma_Child_And_Adjacent()
+ {
+ Assert.AreEqual(3, SelectList("a + span, div > p").Count);
+ }

- [Test]
- public void General_Sibling_Combinator()
- {
- Assert.AreEqual(1, SelectList("div ~ form").Count);
- Assert.AreEqual("form", SelectList("div ~ form")[0].Name);
- }
- }
+ [Test]
+ public void General_Sibling_Combinator()
+ {
+ Assert.AreEqual(1, SelectList("div ~ form").Count);
+ Assert.AreEqual("form", SelectList("div ~ form")[0].Name);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/ClassSelector.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/ClassSelector.cs Thu Jan 17 15:49:10 2013
@@ -3,49 +3,49 @@
using NUnit.Framework;

[TestFixture]
- public class ClassSelector : SelectorBaseTest
- {
- [Test]
- public void Basic()
- {
- var result = SelectList(".checkit");
+ public class ClassSelector : SelectorBaseTest
+ {
+ [Test]
+ public void Basic()
+ {
+ var result = SelectList(".checkit");

- Assert.AreEqual(2, result.Count);
- Assert.AreEqual("div", result[0].Name);
- Assert.AreEqual("div", result[1].Name);
- }
-
- /// <summary>
- /// Should match class="omg ohyeah"
- /// </summary>
- [Test]
- public void Chained()
- {
- var result = SelectList(".omg.ohyeah");
+ Assert.AreEqual(2, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ Assert.AreEqual("div", result[1].Name);
+ }
+
+ /// <summary>
+ /// Should match class="omg ohyeah"
+ /// </summary>
+ [Test]
+ public void Chained()
+ {
+ var result = SelectList(".omg.ohyeah");

- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("eeeee", result[0].InnerText);
- }
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("eeeee", result[0].InnerText);
+ }

- [Test]
- public void With_Element()
- {
- var result = SelectList("p.ohyeah");
+ [Test]
+ public void With_Element()
+ {
+ var result = SelectList("p.ohyeah");

- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("eeeee", result[0].InnerText);
- }
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("eeeee", result[0].InnerText);
+ }

- [Test]
- public void Parent_Class_Selector()
- {
- var result = SelectList("div .ohyeah");
+ [Test]
+ public void Parent_Class_Selector()
+ {
+ var result = SelectList("div .ohyeah");

- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("eeeee", result[0].InnerText);
- }
- }
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("eeeee", result[0].InnerText);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/ElementSelector.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/ElementSelector.cs Thu Jan 17 15:49:10 2013
@@ -4,69 +4,69 @@
using NUnit.Framework;

[TestFixture]
- public class ElementSelector : SelectorBaseTest
- {
- [Test]
- public void Star()
- {
- Assert.AreEqual(16, SelectList("*").Count);
- }
-
- [Test]
- public void Single_Tag_Name()
- {
- Assert.AreEqual(1, SelectList("body").Count);
- Assert.AreEqual("body", SelectList("body")[0].Name);
- }
-
- [Test]
- public void Single_Tag_Name_Matching_Multiple_Elements()
- {
- Assert.AreEqual(3, SelectList("p").Count);
- Assert.AreEqual("p", SelectList("p")[0].Name);
- Assert.AreEqual("p", SelectList("p")[1].Name);
- Assert.AreEqual("p", SelectList("p")[2].Name);
- }
-
- [Test]
- public void Basic_Negative_Precedence()
- {
- Assert.AreEqual(0, SelectList("head p").Count);
- }
+ public class ElementSelector : SelectorBaseTest
+ {
+ [Test]
+ public void Star()
+ {
+ Assert.AreEqual(16, SelectList("*").Count);
+ }
+
+ [Test]
+ public void Single_Tag_Name()
+ {
+ Assert.AreEqual(1, SelectList("body").Count);
+ Assert.AreEqual("body", SelectList("body")[0].Name);
+ }
+
+ [Test]
+ public void Single_Tag_Name_Matching_Multiple_Elements()
+ {
+ Assert.AreEqual(3, SelectList("p").Count);
+ Assert.AreEqual("p", SelectList("p")[0].Name);
+ Assert.AreEqual("p", SelectList("p")[1].Name);
+ Assert.AreEqual("p", SelectList("p")[2].Name);
+ }
+
+ [Test]
+ public void Basic_Negative_Precedence()
+ {
+ Assert.AreEqual(0, SelectList("head p").Count);
+ }

- [Test]
- public void Basic_Positive_Precedence_Two_Tags()
- {
- Assert.AreEqual(2, SelectList("div p").Count);
- }
+ [Test]
+ public void Basic_Positive_Precedence_Two_Tags()
+ {
+ Assert.AreEqual(2, SelectList("div p").Count);
+ }

- [Test]
- public void
Basic_Positive_Precedence_Two_Tags_With_Grandchild_Descendant()
- {
- Assert.AreEqual(2, SelectList("div a").Count);
- }
+ [Test]
+ public void
Basic_Positive_Precedence_Two_Tags_With_Grandchild_Descendant()
+ {
+ Assert.AreEqual(2, SelectList("div a").Count);
+ }

- [Test]
- public void Basic_Positive_Precedence_Three_Tags()
- {
- Assert.AreEqual(1, SelectList("div p a").Count);
- Assert.AreEqual("a", SelectList("div p a")[0].Name);
- }
+ [Test]
+ public void Basic_Positive_Precedence_Three_Tags()
+ {
+ Assert.AreEqual(1, SelectList("div p a").Count);
+ Assert.AreEqual("a", SelectList("div p a")[0].Name);
+ }

- [Test]
- public void Basic_Positive_Precedence_With_Same_Tags()
- {
- Assert.AreEqual(1, SelectList("div div").Count);
- }
+ [Test]
+ public void Basic_Positive_Precedence_With_Same_Tags()
+ {
+ Assert.AreEqual(1, SelectList("div div").Count);
+ }

- /// <summary>
- /// This test covers an issue with HtmlAgilityPack where form
childnodes().length == 0.
- /// </summary>
+ /// <summary>
+ /// This test covers an issue with HtmlAgilityPack where form
childnodes().length == 0.
+ /// </summary>
[Test]
- public void Basic_Positive_Precedence_Within_Form()
- {
- Assert.AreEqual(1, SelectList("form input").Count);
- }
+ public void Basic_Positive_Precedence_Within_Form()
+ {
+ Assert.AreEqual(1, SelectList("form input").Count);
+ }

[Test,ExpectedException(typeof(FormatException))]
public void Type_Star()
=======================================
--- /Fizzler.Tests/HumanReadableSelectorGeneratorTests.cs Tue Feb 2
14:28:39 2010
+++ /Fizzler.Tests/HumanReadableSelectorGeneratorTests.cs Thu Jan 17
15:49:10 2013
@@ -4,149 +4,149 @@
using NUnit.Framework;

[TestFixture]
- public class HumanReadableSelectorGeneratorTests
- {
- public class TestHumanReadableSelectorGenerator :
HumanReadableSelectorGenerator
- {
- public new void Add(string selector)
- {
- base.Add(selector);
- }
- }
+ public class HumanReadableSelectorGeneratorTests
+ {
+ public class TestHumanReadableSelectorGenerator :
HumanReadableSelectorGenerator
+ {
+ public new void Add(string selector)
+ {
+ base.Add(selector);
+ }
+ }

- [Test, ExpectedException(typeof(ArgumentNullException))]
- public void Null_Selector()
- {
- var generator = new TestHumanReadableSelectorGenerator();
- generator.Add(null);
- }
+ [Test, ExpectedException(typeof(ArgumentNullException))]
+ public void Null_Selector()
+ {
+ var generator = new TestHumanReadableSelectorGenerator();
+ generator.Add(null);
+ }

- [Test]
- public void All_Elements()
- {
- Run("*", "Take all elements and select them.");
- }
+ [Test]
+ public void All_Elements()
+ {
+ Run("*", "Take all elements and select them.");
+ }

- [Test]
- public void Tag()
- {
- Run("p", "Take all <p> elements and select them.");
- }
+ [Test]
+ public void Tag()
+ {
+ Run("p", "Take all <p> elements and select them.");
+ }

- [Test]
- public void Descendant()
- {
- Run("p a", "Take all <p> elements, then take their descendants which
are <a> elements and select them.");
- }
+ [Test]
+ public void Descendant()
+ {
+ Run("p a", "Take all <p> elements, then take their descendants
which are <a> elements and select them.");
+ }

- [Test]
- public void Three_Levels_Of_Descendant()
- {
- Run("p a img", "Take all <p> elements, then take their descendants
which are <a> elements. With those, take only their descendants which are
<img> elements and select them.");
- }
+ [Test]
+ public void Three_Levels_Of_Descendant()
+ {
+ Run("p a img", "Take all <p> elements, then take their
descendants which are <a> elements. With those, take only their descendants
which are <img> elements and select them.");
+ }

- [Test]
- public void Attribute()
- {
- Run("a[href]", "Take all <a> elements which have attribute href defined
and select them.");
- }
+ [Test]
+ public void Attribute()
+ {
+ Run("a[href]", "Take all <a> elements which have attribute
href defined and select them.");
+ }

- [Test]
- public void Adjacent()
- {
- Run("a + span", "Take all <a> elements, then take their immediate
siblings which are <span> elements and select them.");
- }
+ [Test]
+ public void Adjacent()
+ {
+ Run("a + span", "Take all <a> elements, then take their
immediate siblings which are <span> elements and select them.");
+ }

- [Test]
- public void Id()
- {
- Run("#nodeId", "Take all elements with an ID of 'nodeId' and select
them.");
- }
+ [Test]
+ public void Id()
+ {
+ Run("#nodeId", "Take all elements with an ID of 'nodeId' and
select them.");
+ }

- [Test]
- public void SelectorGroup()
- {
- Run("a, span", "Take all <a> elements and select them. Combined with
previous, take all <span> elements and select them.");
- }
+ [Test]
+ public void SelectorGroup()
+ {
+ Run("a, span", "Take all <a> elements and select them.
Combined with previous, take all <span> elements and select them.");
+ }

- [Test]
- public void GeneralSibling()
- {
- Run("div ~ p", "Take all <div> elements, then take their siblings which
are <p> elements and select them.");
- }
+ [Test]
+ public void GeneralSibling()
+ {
+ Run("div ~ p", "Take all <div> elements, then take their
siblings which are <p> elements and select them.");
+ }

- [Test]
- public void Empty()
- {
- Run("*:empty", "Take all elements where the element is empty and select
them.");
- }
+ [Test]
+ public void Empty()
+ {
+ Run("*:empty", "Take all elements where the element is empty
and select them.");
+ }

- [Test]
- public void FirstChild()
- {
- Run("*:first-child", "Take all elements which are the first child of
their parent and select them.");
- }
+ [Test]
+ public void FirstChild()
+ {
+ Run("*:first-child", "Take all elements which are the first
child of their parent and select them.");
+ }

- [Test]
- public void Child()
- {
- Run("* > p", "Take all elements, then take their immediate children
which are <p> elements and select them.");
- }
+ [Test]
+ public void Child()
+ {
+ Run("* > p", "Take all elements, then take their immediate
children which are <p> elements and select them.");
+ }

- [Test] public void Class()
- {
- Run(".myclass", "Take all elements with a class of 'myclass' and select
them.");
- }
+ [Test] public void Class()
+ {
+ Run(".myclass", "Take all elements with a class of 'myclass'
and select them.");
+ }

- [Test] public void LastChild()
- {
- Run("*:last-child", "Take all elements which are the last child of
their parent and select them.");
- }
+ [Test] public void LastChild()
+ {
+ Run("*:last-child", "Take all elements which are the last
child of their parent and select them.");
+ }

- [Test]
- public void NthChild()
- {
- Run("*:nth-child(2)", "Take all elements where the element has 1n+2-1
sibling before it and select them.");
- }
+ [Test]
+ public void NthChild()
+ {
+ Run("*:nth-child(2)", "Take all elements where the element has
1n+2-1 sibling before it and select them.");
+ }

- [Test]
- public void OnlyChild()
- {
- Run("*:only-child", "Take all elements where the element is the only
child and select them.");
- }
+ [Test]
+ public void OnlyChild()
+ {
+ Run("*:only-child", "Take all elements where the element is
the only child and select them.");
+ }

- [Test] public void AttributeDashMatch()
- {
- Run("*[lang|='en']", "Take all elements which have attribute lang with
a hyphen separated value matching 'en' and select them.");
- }
- [Test] public void AttributeExact()
- {
- Run("*[title='hithere']", "Take all elements which have attribute title
with a value of 'hithere' and select them.");
- }
- [Test] public void AttributeIncludes()
- {
- Run("*[title~='hithere']", "Take all elements which have attribute
title that includes the word 'hithere' and select them.");
- }
- [Test] public void AttributeSubstring()
- {
- Run("*[title*='hithere']", "Take all elements which have attribute
title whose value contains 'hithere' and select them.");
- }
- [Test] public void AttributeSuffixMatch()
- {
- Run("*[title$='hithere']", "Take all elements which have attribute
title whose value ends with 'hithere' and select them.");
- }
+ [Test] public void AttributeDashMatch()
+ {
+ Run("*[lang|='en']", "Take all elements which have attribute
lang with a hyphen separated value matching 'en' and select them.");
+ }
+ [Test] public void AttributeExact()
+ {
+ Run("*[title='hithere']", "Take all elements which have
attribute title with a value of 'hithere' and select them.");
+ }
+ [Test] public void AttributeIncludes()
+ {
+ Run("*[title~='hithere']", "Take all elements which have
attribute title that includes the word 'hithere' and select them.");
+ }
+ [Test] public void AttributeSubstring()
+ {
+ Run("*[title*='hithere']", "Take all elements which have
attribute title whose value contains 'hithere' and select them.");
+ }
+ [Test] public void AttributeSuffixMatch()
+ {
+ Run("*[title$='hithere']", "Take all elements which have
attribute title whose value ends with 'hithere' and select them.");
+ }

- [Test]
- public void AttributePrefixMatch()
- {
- Run("*[title^='hithere']", "Take all elements which have attribute
title whose value begins with 'hithere' and select them.");
- }
+ [Test]
+ public void AttributePrefixMatch()
+ {
+ Run("*[title^='hithere']", "Take all elements which have
attribute title whose value begins with 'hithere' and select them.");
+ }

- private static void Run(string selector, string message)
- {
- var generator = new HumanReadableSelectorGenerator();
- Parser.Parse(selector, generator);
- Assert.AreEqual(message, generator.Text);
- }
- }
+ private static void Run(string selector, string message)
+ {
+ var generator = new HumanReadableSelectorGenerator();
+ Parser.Parse(selector, generator);
+ Assert.AreEqual(message, generator.Text);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/IDSelector.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/IDSelector.cs Thu Jan 17 15:49:10 2013
@@ -3,94 +3,94 @@
using NUnit.Framework;

[TestFixture]
- public class IDSelector : SelectorBaseTest
- {
- [Test]
- public void Basic_Selector()
- {
- var result = SelectList("#myDiv");
-
- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("div", result[0].Name);
- }
+ public class IDSelector : SelectorBaseTest
+ {
+ [Test]
+ public void Basic_Selector()
+ {
+ var result = SelectList("#myDiv");
+
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ }

- [Test]
- public void With_Element()
- {
- var result = SelectList("div#myDiv");
+ [Test]
+ public void With_Element()
+ {
+ var result = SelectList("div#myDiv");

- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("div", result[0].Name);
- }
-
- [Test]
- public void With_Existing_ID_Descendant()
- {
- var result = SelectList("#theBody #myDiv");
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ }
+
+ [Test]
+ public void With_Existing_ID_Descendant()
+ {
+ var result = SelectList("#theBody #myDiv");

- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("div", result[0].Name);
- }
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ }

- [Test]
- public void With_Non_Existant_ID_Descendant()
- {
- var result = SelectList("#theBody #whatwhatwhat");
+ [Test]
+ public void With_Non_Existant_ID_Descendant()
+ {
+ var result = SelectList("#theBody #whatwhatwhat");

- Assert.AreEqual(0, result.Count);
- }
+ Assert.AreEqual(0, result.Count);
+ }

- [Test]
- public void With_Non_Existant_ID_Ancestor()
- {
- var result = SelectList("#whatwhatwhat #someOtherDiv");
+ [Test]
+ public void With_Non_Existant_ID_Ancestor()
+ {
+ var result = SelectList("#whatwhatwhat #someOtherDiv");

- Assert.AreEqual(0, result.Count);
- }
+ Assert.AreEqual(0, result.Count);
+ }

- [Test]
- public void All_Descendants_Of_ID()
- {
- var result = SelectList("#myDiv *");
+ [Test]
+ public void All_Descendants_Of_ID()
+ {
+ var result = SelectList("#myDiv *");

- Assert.AreEqual(5, result.Count);
- Assert.AreEqual("div", result[0].Name);
- Assert.AreEqual("p", result[1].Name);
- }
-
- [Test]
- public void Child_ID()
- {
- var result = SelectList("#theBody>#myDiv");
+ Assert.AreEqual(5, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ Assert.AreEqual("p", result[1].Name);
+ }
+
+ [Test]
+ public void Child_ID()
+ {
+ var result = SelectList("#theBody>#myDiv");

- Assert.AreEqual(1, result.Count);
- Assert.AreEqual("div", result[0].Name);
- }
+ Assert.AreEqual(1, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ }

- [Test]
- public void Not_A_Child_ID()
- {
- var result = SelectList("#theBody>#someOtherDiv");
+ [Test]
+ public void Not_A_Child_ID()
+ {
+ var result = SelectList("#theBody>#someOtherDiv");

- Assert.AreEqual(0, result.Count);
- }
-
- [Test]
- public void All_Children_Of_ID()
- {
- var result = SelectList("#myDiv>*");
+ Assert.AreEqual(0, result.Count);
+ }
+
+ [Test]
+ public void All_Children_Of_ID()
+ {
+ var result = SelectList("#myDiv>*");

- Assert.AreEqual(2, result.Count);
- Assert.AreEqual("div", result[0].Name);
- Assert.AreEqual("p", result[1].Name);
- }
-
- [Test]
- public void All_Children_of_ID_with_no_children()
- {
- var result = SelectList("#someOtherDiv>*");
+ Assert.AreEqual(2, result.Count);
+ Assert.AreEqual("div", result[0].Name);
+ Assert.AreEqual("p", result[1].Name);
+ }
+
+ [Test]
+ public void All_Children_of_ID_with_no_children()
+ {
+ var result = SelectList("#someOtherDiv>*");

- Assert.AreEqual(0, result.Count);
- }
- }
+ Assert.AreEqual(0, result.Count);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/MultipleSelectors.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/MultipleSelectors.cs Thu Jan 17 15:49:10 2013
@@ -3,46 +3,46 @@
using NUnit.Framework;

[TestFixture]
- public class MultipleSelectors : SelectorBaseTest
- {
- [Test]
- public void CommaSupport_With_No_Space()
- {
- var result = SelectList("p.hiclass,a");
+ public class MultipleSelectors : SelectorBaseTest
+ {
+ [Test]
+ public void CommaSupport_With_No_Space()
+ {
+ var result = SelectList("p.hiclass,a");

- Assert.AreEqual(3, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("a", result[1].Name);
- }
+ Assert.AreEqual(3, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("a", result[1].Name);
+ }

- [Test]
- public void CommaSupport_With_Post_Pended_Space()
- {
- var result = SelectList("p.hiclass, a");
-
- Assert.AreEqual(3, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("a", result[1].Name);
- }
+ [Test]
+ public void CommaSupport_With_Post_Pended_Space()
+ {
+ var result = SelectList("p.hiclass, a");
+
+ Assert.AreEqual(3, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("a", result[1].Name);
+ }

- [Test]
- public void CommaSupport_With_Pre_Post_Pended_Space()
- {
- var result = SelectList("p.hiclass , a");
+ [Test]
+ public void CommaSupport_With_Pre_Post_Pended_Space()
+ {
+ var result = SelectList("p.hiclass , a");

- Assert.AreEqual(3, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("a", result[1].Name);
- }
+ Assert.AreEqual(3, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("a", result[1].Name);
+ }

- [Test]
- public void CommaSupport_With_Pre_Pended_Space()
- {
- var result = SelectList("p.hiclass ,a");
+ [Test]
+ public void CommaSupport_With_Pre_Pended_Space()
+ {
+ var result = SelectList("p.hiclass ,a");

- Assert.AreEqual(3, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("a", result[1].Name);
- }
- }
+ Assert.AreEqual(3, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("a", result[1].Name);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/NthChild.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/NthChild.cs Thu Jan 17 15:49:10 2013
@@ -3,43 +3,43 @@
using NUnit.Framework;

[TestFixture]
- public class NthChild : SelectorBaseTest
- {
- /// <summary>
- /// Behaves the same as *:nth-child(2)
- /// </summary>
- [Test]
- public void No_Prefix_With_Digit()
- {
- var result = SelectList(":nth-child(2)");
+ public class NthChild : SelectorBaseTest
+ {
+ /// <summary>
+ /// Behaves the same as *:nth-child(2)
+ /// </summary>
+ [Test]
+ public void No_Prefix_With_Digit()
+ {
+ var result = SelectList(":nth-child(2)");

- Assert.AreEqual(4, result.Count);
- Assert.AreEqual("body", result[0].Name);
- Assert.AreEqual("p", result[1].Name);
- Assert.AreEqual("span", result[2].Name);
- Assert.AreEqual("p", result[3].Name);
- }
-
- [Test]
- public void Star_Prefix_With_Digit()
- {
- var result = SelectList("*:nth-child(2)");
+ Assert.AreEqual(4, result.Count);
+ Assert.AreEqual("body", result[0].Name);
+ Assert.AreEqual("p", result[1].Name);
+ Assert.AreEqual("span", result[2].Name);
+ Assert.AreEqual("p", result[3].Name);
+ }
+
+ [Test]
+ public void Star_Prefix_With_Digit()
+ {
+ var result = SelectList("*:nth-child(2)");

- Assert.AreEqual(4, result.Count);
- Assert.AreEqual("body", result[0].Name);
- Assert.AreEqual("p", result[1].Name);
- Assert.AreEqual("span", result[2].Name);
- Assert.AreEqual("p", result[3].Name);
- }
+ Assert.AreEqual(4, result.Count);
+ Assert.AreEqual("body", result[0].Name);
+ Assert.AreEqual("p", result[1].Name);
+ Assert.AreEqual("span", result[2].Name);
+ Assert.AreEqual("p", result[3].Name);
+ }

- [Test]
- public void Element_Prefix_With_Digit()
- {
- var result = SelectList("p:nth-child(2)");
+ [Test]
+ public void Element_Prefix_With_Digit()
+ {
+ var result = SelectList("p:nth-child(2)");

- Assert.AreEqual(2, result.Count);
- Assert.AreEqual("p", result[0].Name);
- Assert.AreEqual("p", result[1].Name);
- }
- }
+ Assert.AreEqual(2, result.Count);
+ Assert.AreEqual("p", result[0].Name);
+ Assert.AreEqual("p", result[1].Name);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/PsuedoSelectors.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/PsuedoSelectors.cs Thu Jan 17 15:49:10 2013
@@ -3,36 +3,36 @@
using NUnit.Framework;

[TestFixture]
- public class PsuedoSelectors : SelectorBaseTest
- {
- [Test]
- public void First_Child()
- {
- Assert.AreEqual(8, SelectList("*:first-child").Count);
- Assert.AreEqual(1, SelectList("p:first-child").Count);
- }
+ public class PsuedoSelectors : SelectorBaseTest
+ {
+ [Test]
+ public void First_Child()
+ {
+ Assert.AreEqual(8, SelectList("*:first-child").Count);
+ Assert.AreEqual(1, SelectList("p:first-child").Count);
+ }

- [Test]
- public void Last_Child()
- {
- Assert.AreEqual(7, SelectList("*:last-child").Count);
- Assert.AreEqual(2, SelectList("p:last-child").Count);
- }
+ [Test]
+ public void Last_Child()
+ {
+ Assert.AreEqual(7, SelectList("*:last-child").Count);
+ Assert.AreEqual(2, SelectList("p:last-child").Count);
+ }

- [Test]
- public void Only_Child()
- {
- Assert.AreEqual(3, SelectList("*:only-child").Count);
- Assert.AreEqual(1, SelectList("p:only-child").Count);
- }
+ [Test]
+ public void Only_Child()
+ {
+ Assert.AreEqual(3, SelectList("*:only-child").Count);
+ Assert.AreEqual(1, SelectList("p:only-child").Count);
+ }

- [Test]
- public void Empty()
- {
- var results = SelectList("*:empty");
- Assert.AreEqual(2, results.Count);
- Assert.AreEqual("head", results[0].Name);
- Assert.AreEqual("input", results[1].Name);
- }
- }
+ [Test]
+ public void Empty()
+ {
+ var results = SelectList("*:empty");
+ Assert.AreEqual(2, results.Count);
+ Assert.AreEqual("head", results[0].Name);
+ Assert.AreEqual("input", results[1].Name);
+ }
+ }
}
=======================================
--- /Fizzler.Tests/SelectorBaseTest.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/SelectorBaseTest.cs Thu Jan 17 15:49:10 2013
@@ -14,12 +14,12 @@
#endregion

public abstract class SelectorBaseTest
- {
- protected SelectorBaseTest()
- {
+ {
+ protected SelectorBaseTest()
+ {
string html;
- var assembly = Assembly.GetExecutingAssembly();
- const string resourceName = "Fizzler.Tests.SelectorTest.html";
+ var assembly = Assembly.GetExecutingAssembly();
+ const string resourceName = "Fizzler.Tests.SelectorTest.html";
using (var stream =
assembly.GetManifestResourceStream(resourceName))
{
if (stream == null)
@@ -27,14 +27,14 @@
using(var reader = new StreamReader(stream))
html = reader.ReadToEnd();
}
- var document = new HtmlDocument();
+ var document = new HtmlDocument();
document.LoadHtml2(html);
Document = document;
}

- protected HtmlDocument Document { get; private set; }
+ protected HtmlDocument Document { get; private set; }

- protected IEnumerable<HtmlNode> Select(string selectorChain)
+ protected IEnumerable<HtmlNode> Select(string selectorChain)
{
return Document.DocumentNode.QuerySelectorAll(selectorChain);
}
=======================================
--- /Fizzler.Tests/TokenTests.cs Thu Jan 17 15:22:04 2013
+++ /Fizzler.Tests/TokenTests.cs Thu Jan 17 15:49:10 2013
@@ -234,11 +234,11 @@
AssertToken(TokenKind.SubstringMatch, Token.SubstringMatch());
}

- [Test]
- public void GeneralSibling()
- {
- AssertToken(TokenKind.Tilde, Token.Tilde());
- }
+ [Test]
+ public void GeneralSibling()
+ {
+ AssertToken(TokenKind.Tilde, Token.Tilde());
+ }

[Test]
public void Pipe()
=======================================
--- /Fizzler.Tests/TokenerTests.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Tests/TokenerTests.cs Thu Jan 17 15:49:10 2013
@@ -283,17 +283,17 @@
Assert.AreEqual(new[] { Token.Char('*'), Token.Char('*') },
Tokener.Tokenize("**").Take(2).ToArray());
}

- [Test]
- public void Tilde()
- {
- Assert.AreEqual(TokenKind.Tilde, Tokener.Tokenize("~").First().Kind);
- }
+ [Test]
+ public void Tilde()
+ {
+ Assert.AreEqual(TokenKind.Tilde,
Tokener.Tokenize("~").First().Kind);
+ }

- [Test]
+ [Test]
public void TildeWhitespacePrepended()
- {
- Assert.AreEqual(TokenKind.Tilde, Tokener.Tokenize(" ~").First().Kind);
- }
+ {
+ Assert.AreEqual(TokenKind.Tilde, Tokener.Tokenize("
~").First().Kind);
+ }

[Test,ExpectedException(typeof(FormatException))]
public void StringSingleQuoteUnterminated()
=======================================
--- /Fizzler/IElementOps.cs Wed Oct 6 16:15:18 2010
+++ /Fizzler/IElementOps.cs Thu Jan 17 15:49:10 2013
@@ -151,19 +151,19 @@
/// </summary>
Selector<TElement> Adjacent();

- /// <summary>
- /// Generates a <a
href="http://www.w3.org/TR/css3-selectors/#combinators">combinator</a>,
- /// which separates two sequences of simple selectors. The elements
represented
- /// by the two sequences share the same parent in the document tree and
the
- /// element represented by the first sequence precedes (not necessarily
- /// immediately) the element represented by the second one.
- /// </summary>
- Selector<TElement> GeneralSibling();
+ /// <summary>
+ /// Generates a <a
href="http://www.w3.org/TR/css3-selectors/#combinators">combinator</a>,
+ /// which separates two sequences of simple selectors. The
elements represented
+ /// by the two sequences share the same parent in the document
tree and the
+ /// element represented by the first sequence precedes (not
necessarily
+ /// immediately) the element represented by the second one.
+ /// </summary>
+ Selector<TElement> GeneralSibling();

- /// <summary>
- /// Generates a <a
href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class
selector</a>,
- /// which represents an element that is the N-th child from bottom up of
some other element.
- /// </summary>
- Selector<TElement> NthLastChild(int a, int b);
+ /// <summary>
+ /// Generates a <a
href="http://www.w3.org/TR/css3-selectors/#pseudo-classes">pseudo-class
selector</a>,
+ /// which represents an element that is the N-th child from bottom
up of some other element.
+ /// </summary>
+ Selector<TElement> NthLastChild(int a, int b);
}
}
=======================================
--- /Fizzler/Token.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler/Token.cs Thu Jan 17 15:49:10 2013
@@ -171,13 +171,13 @@
return new Token(TokenKind.SubstringMatch);
}

- /// <summary>
- /// Creates a general sibling token.
- /// </summary>
- public static Token Tilde()
- {
- return new Token(TokenKind.Tilde);
- }
+ /// <summary>
+ /// Creates a general sibling token.
+ /// </summary>
+ public static Token Tilde()
+ {
+ return new Token(TokenKind.Tilde);
+ }

/// <summary>
/// Creates an identifier token.
=======================================
--- /Fizzler/TokenKind.cs Wed Jun 3 13:26:53 2009
+++ /Fizzler/TokenKind.cs Thu Jan 17 15:49:10 2013
@@ -75,10 +75,10 @@
/// </summary>
Integer,

- /// <summary>
- /// Represents S* "~"
- /// </summary>
- Tilde,
+ /// <summary>
+ /// Represents S* "~"
+ /// </summary>
+ Tilde,

/// <summary>
/// Represents an arbitrary character
=======================================
--- /NET-2.0/ExtensionAttribute.cs Tue Apr 28 10:32:15 2009
+++ /NET-2.0/ExtensionAttribute.cs Thu Jan 17 15:49:10 2013
@@ -1,6 +1,6 @@
namespace System.Runtime.CompilerServices
{
- class ExtensionAttribute :Attribute
- {
- }
+ class ExtensionAttribute :Attribute
+ {
+ }
}

==============================================================================
Revision: 80f3ee0292c0
Branch: default
Author: azizatif
Date: Thu Jan 17 15:50:57 2013
Log: Deleting unused files
http://code.google.com/p/fizzler/source/detail?r=80f3ee0292c0

Deleted:
/NET-2.0/Actions.cs
/NET-2.0/ExtensionAttribute.cs
/NET-2.0/Fizzler.Systems.XmlNodeQuery/Fizzler.Systems.XmlNodeQuery.csproj

=======================================
--- /NET-2.0/Actions.cs Tue Jun 2 06:35:41 2009
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace System
-{
- internal delegate void Action();
- internal delegate void Action<T1, T2>(T1 arg1, T2 arg2);
- internal delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3);
-}
=======================================
--- /NET-2.0/ExtensionAttribute.cs Thu Jan 17 15:49:10 2013
+++ /dev/null
@@ -1,6 +0,0 @@
-namespace System.Runtime.CompilerServices
-{
- class ExtensionAttribute :Attribute
- {
- }
-}
=======================================
---
/NET-2.0/Fizzler.Systems.XmlNodeQuery/Fizzler.Systems.XmlNodeQuery.csproj
Thu Jan 17 15:22:04 2013
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)'
== '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.21022</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{1D34B151-2657-4A2B-AB2A-C7FBBB3935E8}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Fizzler.Systems.XmlNodeQuery</RootNamespace>
- <AssemblyName>Fizzler.Systems.XmlNodeQuery</AssemblyName>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|
AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|
AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="BackLinq, Version=1.0.0.0, Culture=neutral,
processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Libs\BackLinq.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\Fizzler.Systems.XmlNodeQuery\XmlNodeOps.cs" />
- <Compile
Include="..\Fizzler.Systems.XmlNodeQuery\XmlNodeExtensions.cs" />
- <Compile Include="..\Fizzler.Systems.XmlNodeQuery\XmlNodeSelection.cs"
/>
- <Compile Include="ExtensionAttribute.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="Fizzler.csproj">
- <Project>{278E9225-9FE5-4D63-9C9B-206FC68BAA37}</Project>
- <Name>Fizzler %28NET-2.0\Fizzler%29</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="Properties\" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the
targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>

==============================================================================
Revision: 76ba184b53c5
Branch: default
Author: azizatif
Date: Thu Jan 17 15:53:37 2013
Log: Removing UTF-8 BOM from source files
http://code.google.com/p/fizzler/source/detail?r=76ba184b53c5

Modified:
/ConsoleFizzler/CommandLine.cs
/ConsoleFizzler/NameValueCollectionExtensions.cs
/ConsoleFizzler/Program.cs
/ConsoleFizzler/Properties/AssemblyInfo.cs
/ConsoleFizzler/StringExtensions.cs
/Fizzler.Sandbox/Properties/AssemblyInfo.cs
/Fizzler.Sandbox/WinForms/ControlExtensions.cs
/Fizzler.Sandbox/WinForms/ControlSelection.cs
/Fizzler.Systems.HtmlAgilityPack/HtmlDocumentExtensions.cs
/Fizzler.Systems.HtmlAgilityPack/HtmlNodeSelection.cs
/Fizzler.Systems.HtmlAgilityPack/Properties/AssemblyInfo.cs
/Fizzler.Tests/ElementSelector.cs
/Fizzler.Tests/Properties/AssemblyInfo.cs
/Fizzler.Tests/TokenTests.cs
/Fizzler/NamespacePrefix.cs
/Fizzler/Properties/AssemblyInfo.cs
/Fizzler/Reader.cs
/Fizzler/Tokener.cs
/VisualFizzler/ContentTypeExtensions.cs
/VisualFizzler/MainForm.Designer.cs
/VisualFizzler/MainForm.cs
/VisualFizzler/Program.cs
/VisualFizzler/Properties/AssemblyInfo.cs
/VisualFizzler/Properties/Resources.Designer.cs
/VisualFizzler/Properties/Settings.Designer.cs

=======================================
--- /ConsoleFizzler/CommandLine.cs Tue Feb 2 14:46:14 2010
+++ /ConsoleFizzler/CommandLine.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using Mannex;
+using Mannex;

namespace ConsoleFizzler
{
=======================================
--- /ConsoleFizzler/NameValueCollectionExtensions.cs Tue Feb 2 14:28:39
2010
+++ /ConsoleFizzler/NameValueCollectionExtensions.cs Thu Jan 17 15:53:37
2013
@@ -1,4 +1,4 @@
-namespace ConsoleFizzler
+namespace ConsoleFizzler
{
#region Imports

=======================================
--- /ConsoleFizzler/Program.cs Thu Jan 17 15:49:10 2013
+++ /ConsoleFizzler/Program.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace ConsoleFizzler
+namespace ConsoleFizzler
{
#region Imports

=======================================
--- /ConsoleFizzler/Properties/AssemblyInfo.cs Fri May 1 06:06:07 2009
+++ /ConsoleFizzler/Properties/AssemblyInfo.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;

[assembly: AssemblyTitle("ConsoleFizzler")]
[assembly: AssemblyDescription("Fizzler Console Application")]
=======================================
--- /ConsoleFizzler/StringExtensions.cs Tue Feb 2 14:46:14 2010
+++ /ConsoleFizzler/StringExtensions.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace ConsoleFizzler
+namespace ConsoleFizzler
{
#region Imports

=======================================
--- /Fizzler.Sandbox/Properties/AssemblyInfo.cs Fri May 1 06:06:07 2009
+++ /Fizzler.Sandbox/Properties/AssemblyInfo.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;

[assembly: AssemblyTitle("Fizzler.Sandbox")]
[assembly: AssemblyDescription("Fizzler sandbox for experiments and
futures")]
=======================================
--- /Fizzler.Sandbox/WinForms/ControlExtensions.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Sandbox/WinForms/ControlExtensions.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler.Systems.WinForms
+namespace Fizzler.Systems.WinForms
{
#region Imports

=======================================
--- /Fizzler.Sandbox/WinForms/ControlSelection.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler.Sandbox/WinForms/ControlSelection.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler.Systems.WinForms
+namespace Fizzler.Systems.WinForms
{
#region Imports

=======================================
--- /Fizzler.Systems.HtmlAgilityPack/HtmlDocumentExtensions.cs Thu Jan 17
15:22:04 2013
+++ /Fizzler.Systems.HtmlAgilityPack/HtmlDocumentExtensions.cs Thu Jan 17
15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Collections.Generic;
+using System.Collections.Generic;
using System.Diagnostics;

namespace Fizzler.Systems.HtmlAgilityPack
=======================================
--- /Fizzler.Systems.HtmlAgilityPack/HtmlNodeSelection.cs Tue Feb 2
14:28:39 2010
+++ /Fizzler.Systems.HtmlAgilityPack/HtmlNodeSelection.cs Thu Jan 17
15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler.Systems.HtmlAgilityPack
+namespace Fizzler.Systems.HtmlAgilityPack
{
#region Imports

=======================================
--- /Fizzler.Systems.HtmlAgilityPack/Properties/AssemblyInfo.cs Wed Nov 11
17:13:55 2009
+++ /Fizzler.Systems.HtmlAgilityPack/Properties/AssemblyInfo.cs Thu Jan 17
15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;

[assembly: AssemblyTitle("Fizzler.System.HtmlAgilityPack")]
[assembly: AssemblyDescription("Fizzler for HtmlAgilityPack")]
=======================================
--- /Fizzler.Tests/ElementSelector.cs Thu Jan 17 15:49:10 2013
+++ /Fizzler.Tests/ElementSelector.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler.Tests
+namespace Fizzler.Tests
{
using System;
using NUnit.Framework;
=======================================
--- /Fizzler.Tests/Properties/AssemblyInfo.cs Sat Oct 4 17:45:57 2008
+++ /Fizzler.Tests/Properties/AssemblyInfo.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

@@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Fizzle.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyCopyright("Copyright (c) 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

=======================================
--- /Fizzler.Tests/TokenTests.cs Thu Jan 17 15:49:10 2013
+++ /Fizzler.Tests/TokenTests.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler.Tests
+namespace Fizzler.Tests
{
#region Imports

=======================================
--- /Fizzler/NamespacePrefix.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler/NamespacePrefix.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler
+namespace Fizzler
{
using System;

=======================================
--- /Fizzler/Properties/AssemblyInfo.cs Wed Nov 11 17:13:55 2009
+++ /Fizzler/Properties/AssemblyInfo.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;

[assembly: AssemblyTitle("Fizzler")]
[assembly: AssemblyDescription("CSS Selector Engine for .NET")]
=======================================
--- /Fizzler/Reader.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler/Reader.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler
+namespace Fizzler
{
#region Imports

=======================================
--- /Fizzler/Tokener.cs Tue Feb 2 14:28:39 2010
+++ /Fizzler/Tokener.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace Fizzler
+namespace Fizzler
{
#region Imports

=======================================
--- /VisualFizzler/ContentTypeExtensions.cs Wed Apr 29 08:27:02 2009
+++ /VisualFizzler/ContentTypeExtensions.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Net.Mime;

namespace VisualFizzler
=======================================
--- /VisualFizzler/MainForm.Designer.cs Wed Apr 29 02:07:26 2009
+++ /VisualFizzler/MainForm.Designer.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-namespace VisualFizzler
+namespace VisualFizzler
{
partial class MainForm
{
=======================================
--- /VisualFizzler/MainForm.cs Wed Jan 9 04:38:17 2013
+++ /VisualFizzler/MainForm.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
=======================================
--- /VisualFizzler/Program.cs Tue Jun 16 16:12:40 2009
+++ /VisualFizzler/Program.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
=======================================
--- /VisualFizzler/Properties/AssemblyInfo.cs Fri May 1 06:06:07 2009
+++ /VisualFizzler/Properties/AssemblyInfo.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-using System.Reflection;
+using System.Reflection;

[assembly: AssemblyTitle("VisualFizzler")]
[assembly: AssemblyDescription("Visual Fizzler WinForms Application")]
=======================================
--- /VisualFizzler/Properties/Resources.Designer.cs Fri Jan 4 23:46:20 2013
+++ /VisualFizzler/Properties/Resources.Designer.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18010
=======================================
--- /VisualFizzler/Properties/Settings.Designer.cs Fri Jan 4 23:46:20 2013
+++ /VisualFizzler/Properties/Settings.Designer.cs Thu Jan 17 15:53:37 2013
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18010

==============================================================================
Revision: 8fd9851b85e7
Branch: default
Author: azizatif
Date: Thu Jan 17 16:03:37 2013
Log: Ignoring Hg bundles
http://code.google.com/p/fizzler/source/detail?r=8fd9851b85e7

Modified:
/.hgignore

=======================================
--- /.hgignore Thu Jan 17 15:22:04 2013
+++ /.hgignore Thu Jan 17 16:03:37 2013
@@ -16,3 +16,4 @@
pkg/*/**
*.nupkg
packages/**
+*.hg
Reply all
Reply to author
Forward
0 new messages