BatchFlow.UnitTests.Helpers.GetStartpointCounter C# (CSharp) Метод

GetStartpointCounter() статический приватный Метод

static private GetStartpointCounter ( int from, int to ) : StartPoint
from int
to int
Результат StartPoint
        internal static StartPoint<int> GetStartpointCounter(int from, int to)
        {
            StartPoint<int> s = new StartPoint<int>(
                (IWritableQueue<int> o) =>
                {
                    for (int i = from; i <= to; i++)
                    {
                        o.Send(i);
                    }
                }
                );
            return s;
        }

Usage Example

Пример #1
0
        public void IllegalAsciiArt1()
        {
            List <string> results = new List <string>();

            StartPoint <int>       s      = Helpers.GetStartpointCounter(1, 15);
            TaskNode <int, string> filter = Helpers.GetFilter();
            EndPoint <string>      n      = Helpers.GetEndpoint(results);

            try
            {
                Flow flow = Flow.FromAsciiArt(@"
   a----->b->c
     <--
",
                                              new Dictionary <char, TaskNode>()
                {
                    { 'a', s },
                    { 'b', filter },
                    { 'c', n }
                }
                                              );
            }
            catch (InvalidOperationException)
            {
                return;
            }
            Assert.Fail("loose arrows should throw exception");
        }
All Usage Examples Of BatchFlow.UnitTests.Helpers::GetStartpointCounter