From 764190c3e05a32758ce00388aa627549fe35cdcb Mon Sep 17 00:00:00 2001 From: gerneio Date: Fri, 11 Jan 2019 18:39:56 -0600 Subject: [PATCH] Aggregate Test Cases Test cases for https://github.com/ENikS/LINQ/pull/80 on https://github.com/ENikS/LINQ/issues/79 --- test/immediate.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/immediate.ts b/test/immediate.ts index 42b23da..3a24565 100644 --- a/test/immediate.ts +++ b/test/immediate.ts @@ -33,6 +33,14 @@ describe('Immediate Execution -', function () { it('Aggregate() - Transform', function () { assert.equal(1814400, Linq.From(simpleArray).Aggregate(1, (a, b) => a * b, o => o / 2)); }); + + it('Aggregate() - Default Value [String]', function () { + assert.equal("123", Linq.From([1, 2, 3]).Aggregate("", (c, n) => c.toString() + n.toString())); + }); + + it('Aggregate() - Default Value [Number]', function () { + assert.equal("0123", Linq.From(["1", "2", "3"]).Aggregate(0, (c, n) => c.toString() + n.toString())); + });