예제 #1
0
                public void Empty()
                {
                    var source = new BreakingList <object>(new List <object>());

                    var(t, x) = source.FirstOrNone();
                    Assert.That(t, Is.False);
                    Assert.That(x, Is.Null);
                }
예제 #2
0
                public void Many()
                {
                    var source = new BreakingList <int>(new List <int> {
                        123, 456
                    });

                    var(t, x) = source.FirstOrNone();
                    Assert.That(t, Is.True);
                    Assert.That(x, Is.EqualTo(123));
                }
예제 #3
0
                public void Many()
                {
                    var source = new BreakingList <object>(new List <object> {
                        123, 456
                    });

                    var(t, x) = source.SingleOrNone();
                    Assert.That(t, Is.False);
                    Assert.That(x, Is.Null);
                }
예제 #4
0
                public void One()
                {
                    var source = new BreakingList <int>(new List <int> {
                        123
                    });

                    var(t, x) = source.SingleOrNone();
                    Assert.That(t, Is.True);
                    Assert.That(x, Is.EqualTo(123));
                }