public void ElementAtWithinRange()
        {
            DataProducer <string> subject = new DataProducer <string>();
            IFuture <string>      result  = subject.ElementAt(2);

            subject.ProduceAndEnd("zero", "one", "two", "three", "four");
            Assert.AreEqual("two", result.Value);
        }
        public void ElementAtOutsideRange()
        {
            DataProducer <string> subject = new DataProducer <string>();

            subject.ElementAt(5);
            subject.Produce("zero");
            subject.Produce("one");
            subject.Produce("two");
            subject.Produce("three");
            try
            {
                subject.End();
                Assert.Fail("Expected exception");
            }
            catch (ArgumentOutOfRangeException)
            {
                // Expected
            }
        }
 public void ElementAtOutsideRange()
 {
     DataProducer<string> subject = new DataProducer<string>();
     subject.ElementAt(5);
     subject.Produce("zero");
     subject.Produce("one");
     subject.Produce("two");
     subject.Produce("three");
     try
     {
         subject.End();
         Assert.Fail("Expected exception");
     }
     catch (ArgumentOutOfRangeException)
     {
         // Expected
     }
 }
 public void ElementAtWithinRange()
 {
     DataProducer<string> subject = new DataProducer<string>();
     IFuture<string> result = subject.ElementAt(2);
     subject.ProduceAndEnd("zero", "one", "two", "three", "four");
     Assert.AreEqual("two", result.Value);
 }