public void LastWithConditionAndData()
        {
            DataProducer <string> subject = new DataProducer <string>();
            IFuture <string>      last    = subject.Last(x => x[0] < 'c');

            subject.ProduceAndEnd("a", "b", "c", "d");
            Assert.AreEqual("b", last.Value);
        }
        public void LastWithoutData()
        {
            DataProducer <string> subject = new DataProducer <string>();

            subject.Last();
            try
            {
                subject.End();
                Assert.Fail("Expected exception");
            }
            catch (InvalidOperationException)
            {
                // Expected
            }
        }
        public void LastWithConditionButNoMatchingData()
        {
            DataProducer <string> subject = new DataProducer <string>();

            subject.Last(x => x.Length > 1);
            subject.Produce("x");
            subject.Produce("y");
            try
            {
                subject.End();
                Assert.Fail("Expected exception");
            }
            catch (InvalidOperationException)
            {
                // Expected
            }
        }
 public void LastWithConditionButNoMatchingData()
 {
     DataProducer<string> subject = new DataProducer<string>();
     subject.Last(x => x.Length > 1);
     subject.Produce("x");
     subject.Produce("y");
     try
     {
         subject.End();
         Assert.Fail("Expected exception");
     }
     catch (InvalidOperationException)
     {
         // Expected
     }
 }
 public void LastWithoutData()
 {
     DataProducer<string> subject = new DataProducer<string>();
     subject.Last();
     try
     {
         subject.End();
         Assert.Fail("Expected exception");
     }
     catch (InvalidOperationException)
     {
         // Expected
     }
 }
 public void LastWithConditionAndData()
 {
     DataProducer<string> subject = new DataProducer<string>();
     IFuture<string> last = subject.Last(x => x[0] < 'c');
     subject.ProduceAndEnd("a", "b", "c", "d");
     Assert.AreEqual("b", last.Value);
 }