Example #1
0
        public void Enumerator_WhenEnumerates1Tuple_ReturnsSelf()
        {
            //Arrange
            var tuple = new Tuple(new Tuple(null), new Fact(1), null);

            //Act
            var target = tuple.ToArray();

            //Assert
            Assert.AreEqual(1, target.Length);
            Assert.AreEqual(tuple.RightFact, target[0]);
        }
Example #2
0
        public void Enumerator_WhenEnumeratesNTuple_WalksTuplesInOrder()
        {
            //Arrange
            var tuple0 = new Tuple(null);
            var tuple1 = new Tuple(tuple0, new Fact(1), null);
            var tuple2 = new Tuple(tuple1, new Fact(2), null);
            var tuple3 = new Tuple(tuple2, new Fact(3), null);

            //Act
            var target = tuple3.ToArray();

            //Assert
            Assert.AreEqual(3, target.Length);
            Assert.AreEqual(tuple1.RightFact, target[0]);
            Assert.AreEqual(tuple2.RightFact, target[1]);
            Assert.AreEqual(tuple3.RightFact, target[2]);
        }