1using System.Collections;
16 IEnumerable d = Enumerable.Range(0, 100);
18 foreach (
object? o
in d.Select(
"x=>x*2"))
23 Assert.That(o, Is.InstanceOf<decimal>());
24 Assert.That((decimal)o % 2, Is.EqualTo(0));
36 IEnumerable d = Enumerable.Range(0, 100);
38 foreach (
object? o
in d.Where(
"x=>x%2==0"))
43 Assert.That(o, Is.InstanceOf<
int>());
44 Assert.That((
int)o % 2, Is.EqualTo(0));
56 IEnumerable d = Enumerable.Range(0, 100);
57 object o = d.Last(
"x=>x%2==0");
58 Assert.That(o, Is.InstanceOf<
int>());
59 Assert.That(o, Is.EqualTo(98));
68 IEnumerable d = Enumerable.Range(0, 100);
69 object o = d.First(
"x=>x%2==0");
70 Assert.That(o, Is.InstanceOf<
int>());
71 Assert.That(o, Is.EqualTo(0));
80 IEnumerable d = Enumerable.Empty<
BadObject>();
81 object? o = d.LastOrDefault(
"x=>x%2==0");
82 Assert.That(o, Is.Null);
91 IEnumerable d = Enumerable.Empty<
BadObject>();
92 object? o = d.FirstOrDefault(
"x=>x%2==0");
94 Assert.That(o, Is.Null);
103 IEnumerable d = Enumerable.Range(0, 100);
104 object[] o = d.Take(10).Cast<
object>().ToArray();
105 Assert.That(o, Has.Length.EqualTo(10));
114 IEnumerable d = Enumerable.Range(0, 100);
115 object[] o = d.Skip(10).Cast<
object>().ToArray();
116 Assert.That(o, Has.Length.EqualTo(90));
125 IEnumerable d = Enumerable.Range(0, 100);
126 object[] o = d.TakeLast(10).Cast<
object>().ToArray();
127 Assert.That(o, Has.Length.EqualTo(10));
136 IEnumerable d = Enumerable.Range(0, 100);
137 object[] o = d.SkipLast(10).Cast<
object>().ToArray();
138 Assert.That(o, Has.Length.EqualTo(90));
158 object[] o = d.SelectMany(
"x=>x").Cast<
object>().ToArray();
159 Assert.That(o, Has.Length.EqualTo(4));
168 IEnumerable d = Enumerable.Range(0, 100);
169 object[] o = d.SkipWhile(
"x=>x < 10").Cast<
object>().ToArray();
170 Assert.That(o, Has.Length.EqualTo(90));
179 IEnumerable d = Enumerable.Range(0, 100);
180 object[] o = d.TakeWhile(
"x=>x < 10").Cast<
object>().ToArray();
181 Assert.That(o, Has.Length.EqualTo(10));
190 IEnumerable d = Enumerable.Range(0, 100);
193 bool o = d.All(
"x=>x < 10");
196 bool o1 = d.All(
"x=>x < 100");
200 Assert.That(o, Is.False);
201 Assert.That(o1, Is.True);
212 IEnumerable d = Enumerable.Range(0, 100);
215 bool o = d.Any(
"x=>x < 0");
218 bool o1 = d.Any(
"x=>x < 100");
219 Assert.That(o, Is.False);
220 Assert.That(o1, Is.True);
Implements a Dynamic List/Array for the BadScript Language.
The Base Class for all BadScript Objects.
void AnyTest()
Tests the Linq.Any Function.
void TakeWhileTest()
Test the Linq.TakeWhile Function.
void FirstOrDefaultTest()
Tests the Linq.FirstOrDefault Function.
void SelectManyTest()
Tests the Linq.SelectMany Function.
void SkipTest()
Tests the Linq.Skip Function.
void LastTest()
Tests the LINQ.Last Function.
void FirstTest()
Tests the Linq.First Function.
void SkipWhileTest()
Tests the Linq.SkipWhile Function.
void TakeTest()
Tests the Linq.Take Function.
void SelectTest()
Tests the LINQ.Select Function.
void TakeLastTest()
Tests the Linq.TakeLast Function.
void WhereTest()
Tests the LINQ.Where Function.
void AllTest()
Tests the Linq.All Function.
void LastOrDefaultTest()
Tests the Linq.LastOrDefault Function.
void SkipLastTest()
Tests the Linq.SkipLast Function.
Contains the Runtime Objects.
Contains the Linq Implementation and Extensions.