Skip to content

Commit

Permalink
use a query for the element tests. This way I don't have to build up …
Browse files Browse the repository at this point in the history
…the query again.
  • Loading branch information
dibiancoj committed Jun 3, 2016
1 parent 14c9b04 commit 7d6afdc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
14 changes: 9 additions & 5 deletions Linq4Javascript/Scripts/UnitTestsRegular.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Linq4Javascript/Scripts/UnitTestsRegular.js.map

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions Linq4Javascript/Scripts/UnitTestsRegular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3633,10 +3633,12 @@ test('JLinq.ElementAt.Test.1', function () {
test('JLinq.ElementAt.ChainTest.1', function () {

//*** ElementAt doens't have a lazy iterator...it just returns the element.
//build the base query
var BaseQuery = UnitTestFramework._Array.Where(x => x.Id > 1);

//go build the query
var ElementAt0 = UnitTestFramework._Array.Where(x => x.Id > 1).ElementAt(0);
var ElementAt1 = UnitTestFramework._Array.Where(x => x.Id > 1).ElementAt(1);
var ElementAt0 = BaseQuery.ElementAt(0);
var ElementAt1 = BaseQuery.ElementAt(1);

//****To-UnitTestFramework._Array Test****

Expand All @@ -3653,7 +3655,7 @@ test('JLinq.ElementAt.ChainTest.1', function () {

//go run the method that should blow up
UnitTestFramework._Array.Where(x => x.Id > 1).ElementAt(5)
}, 'ArgumentOutOfRangeException. The size of the collection is less then the index specified. There are only ' + UnitTestFramework._Array.Where(x => x.Id > 1).Count() + ' elements in the query.');
}, 'ArgumentOutOfRangeException. The size of the collection is less then the index specified. There are only ' + BaseQuery.Count() + ' elements in the query.');
});

//#endregion
Expand Down Expand Up @@ -3685,10 +3687,11 @@ test('JLinq.ElementAtDefault.Test.1', function () {
test('JLinq.ElementAtDefault.ChainTest.1', function () {

//*** ElementAt doens't have a lazy iterator...it just returns the element.
var BaseQuery = UnitTestFramework._Array.Where(x => x.Id > 1);

//go build the query
var ElementAtDefault0 = UnitTestFramework._Array.Where(x => x.Id > 1).ElementAtDefault(0);
var ElementAtDefault1 = UnitTestFramework._Array.Where(x => x.Id > 1).ElementAtDefault(1);
var ElementAtDefault0 = BaseQuery.ElementAtDefault(0);
var ElementAtDefault1 = BaseQuery.ElementAtDefault(1);

//****To-UnitTestFramework._Array Test****

Expand Down

0 comments on commit 7d6afdc

Please sign in to comment.