-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
10,693 additions
and
10,515 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NuGet.CommandLine" version="2.0.40000" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Text; | ||
using System.Reflection; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NUnit.Framework; | ||
using Assert = NUnit.Framework.Assert; | ||
using Description = NUnit.Framework.DescriptionAttribute; | ||
using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext; | ||
using CsQuery; | ||
using CsQuery.Utility; | ||
|
||
namespace CsQuery.Tests.Csharp | ||
{ | ||
/// <summary> | ||
/// This method is largely covered by the jQuery tests | ||
/// </summary> | ||
|
||
public partial class Methods: CsQueryTest | ||
{ | ||
|
||
[Test, TestMethod] | ||
public void Before_MissingTarget() | ||
{ | ||
|
||
var dom = TestDom("TestHtml"); | ||
var len = dom["*"].Length; | ||
|
||
var target = dom["does-not-exist"]; | ||
var content = dom["<div id='content' />"]; | ||
|
||
target.Before(content); | ||
|
||
// nothing was added | ||
Assert.AreEqual(dom["*"].Length, len); | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Text; | ||
using System.Reflection; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NUnit.Framework; | ||
using Assert = NUnit.Framework.Assert; | ||
using Description = NUnit.Framework.DescriptionAttribute; | ||
using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext; | ||
using CsQuery; | ||
using CsQuery.Utility; | ||
|
||
namespace CsQuery.Tests.Csharp | ||
{ | ||
/// <summary> | ||
/// This method is largely covered by the jQuery tests | ||
/// </summary> | ||
|
||
public partial class Methods: CsQueryTest | ||
{ | ||
|
||
[Test, TestMethod] | ||
public void First() | ||
{ | ||
|
||
var dom = TestDom("TestHtml"); | ||
|
||
Assert.AreEqual(1, dom["span"].First().Length); | ||
Assert.AreEqual("hlinks-user", dom["span"].First().Attr("id")); | ||
|
||
Assert.AreEqual(0, dom["not-here"].First().Length); | ||
} | ||
|
||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Text; | ||
using System.Reflection; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NUnit.Framework; | ||
using Assert = NUnit.Framework.Assert; | ||
using Description = NUnit.Framework.DescriptionAttribute; | ||
using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext; | ||
using CsQuery; | ||
using CsQuery.Utility; | ||
|
||
namespace CsQuery.Tests.Csharp | ||
{ | ||
/// <summary> | ||
/// This method is largely covered by the jQuery tests | ||
/// </summary> | ||
|
||
public partial class Methods: CsQueryTest | ||
{ | ||
|
||
[Test, TestMethod] | ||
public void Last() | ||
{ | ||
|
||
var dom = TestDom("TestHtml"); | ||
|
||
Assert.AreEqual(1, dom["div"].Last().Length); | ||
Assert.AreEqual("test-show-last", dom["div"].Last().Attr("id")); | ||
|
||
Assert.AreEqual(0, dom["not-here"].Last().Length); | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Text; | ||
using System.Reflection; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using NUnit.Framework; | ||
using Assert = NUnit.Framework.Assert; | ||
using Description = NUnit.Framework.DescriptionAttribute; | ||
using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext; | ||
using CsQuery; | ||
using CsQuery.Utility; | ||
|
||
namespace CsQuery.Tests.Csharp | ||
{ | ||
/// <summary> | ||
/// This method is largely covered by the jQuery tests | ||
/// </summary> | ||
|
||
public partial class Methods: CsQueryTest | ||
{ | ||
/// <summary> | ||
/// Replace with: ensure that when content is moved between domains, a CsQuery object that was | ||
/// the replacement content remains connected to the content in its new home. | ||
/// </summary> | ||
|
||
[Test, TestMethod] | ||
public void ReplaceWith() | ||
{ | ||
|
||
var dom = TestDom("TestHtml"); | ||
|
||
var target = dom["#test-show-last"]; | ||
var source = CQ.Create("<div id='new-content'><span /></div>"); | ||
|
||
Assert.AreEqual(2, target.Children().Length); | ||
target.ReplaceWith(source); | ||
|
||
Assert.AreEqual(1, source["#hlinks-user"].Length); | ||
Assert.AreEqual(dom["#new-content"][0], source[0]); | ||
} | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters