1using System.Collections;
16 IEnumerable d = Enumerable.Range(0, 100);
18 foreach (
object? o
in d.Select(
"x=>x*2"))
22 Assert.That(o, Is.InstanceOf<decimal>());
23 Assert.That((decimal)o % 2, Is.EqualTo(0));
35 IEnumerable d = Enumerable.Range(0, 100);
37 foreach (
object? o
in d.Where(
"x=>x%2==0"))
41 Assert.That(o, Is.InstanceOf<
int>());
42 Assert.That((
int)o % 2, Is.EqualTo(0));
54 IEnumerable d = Enumerable.Range(0, 100);
55 object o = d.Last(
"x=>x%2==0");
56 Assert.That(o, Is.InstanceOf<
int>());
57 Assert.That(o, Is.EqualTo(98));
66 IEnumerable d = Enumerable.Range(0, 100);
67 object o = d.First(
"x=>x%2==0");
68 Assert.That(o, Is.InstanceOf<
int>());
69 Assert.That(o, Is.EqualTo(0));
78 IEnumerable d = Enumerable.Empty<
BadObject>();
79 object? o = d.LastOrDefault(
"x=>x%2==0");
80 Assert.That(o, Is.Null);
89 IEnumerable d = Enumerable.Empty<
BadObject>();
90 object? o = d.FirstOrDefault(
"x=>x%2==0");
92 Assert.That(o, Is.Null);
101 IEnumerable d = Enumerable.Range(0, 100);
103 object[] o = d.Take(10)
106 Assert.That(o, Has.Length.EqualTo(10));
115 IEnumerable d = Enumerable.Range(0, 100);
117 object[] o = d.Skip(10)
120 Assert.That(o, Has.Length.EqualTo(90));
129 IEnumerable d = Enumerable.Range(0, 100);
131 object[] o = d.TakeLast(10)
134 Assert.That(o, Has.Length.EqualTo(10));
143 IEnumerable d = Enumerable.Range(0, 100);
145 object[] o = d.SkipLast(10)
148 Assert.That(o, Has.Length.EqualTo(90));
158 List<BadObject> a =
new BadObject[] { 1, 2 }.ToList();
161 object[] o = d.SelectMany(
"x=>x")
164 Assert.That(o, Has.Length.EqualTo(4));
173 IEnumerable d = Enumerable.Range(0, 100);
175 object[] o = d.SkipWhile(
"x=>x < 10")
178 Assert.That(o, Has.Length.EqualTo(90));
187 IEnumerable d = Enumerable.Range(0, 100);
189 object[] o = d.TakeWhile(
"x=>x < 10")
192 Assert.That(o, Has.Length.EqualTo(10));
201 IEnumerable d = Enumerable.Range(0, 100);
204 bool o = d.All(
"x=>x < 10");
207 bool o1 = d.All(
"x=>x < 100");
209 Assert.Multiple(() =>
211 Assert.That(o, Is.False);
212 Assert.That(o1, Is.True);
223 IEnumerable d = Enumerable.Range(0, 100);
226 bool o = d.Any(
"x=>x < 0");
229 bool o1 = d.Any(
"x=>x < 100");
230 Assert.That(o, Is.False);
231 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.