当前位置: 首页>>代码示例>>C#>>正文


C# Controller.Process方法代码示例

本文整理汇总了C#中Controller.Process方法的典型用法代码示例。如果您正苦于以下问题:C# Controller.Process方法的具体用法?C# Controller.Process怎么用?C# Controller.Process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Controller的用法示例。


在下文中一共展示了Controller.Process方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Process_PrintsAllRecordsIfFilterIsNull

        public void Process_PrintsAllRecordsIfFilterIsNull()
        {
            const int recordCount = 3;
            var readerMock = new PresidentsRecordReaderMock(InputFilepath, recordCount);

            var controller = new Controller(readerMock, _viewFactoryMock.Object);

            controller.Process(InputFilepath, null, "text");

            Assert.That(_renderedResult.TotalCount, Is.EqualTo(recordCount));
            Assert.That(_renderedResult.Records, Is.EquivalentTo(readerMock.AccessedRecords));
        }
开发者ID:rgavrilov,项目名称:Sogeti,代码行数:12,代码来源:ControllerTest.cs

示例2: Process_IgnoresFirstLineIfInvalid

        public void Process_IgnoresFirstLineIfInvalid()
        {
            const int recordCount = 3;
            var readerMock = new PresidentsRecordReaderMock(InputFilepath, 3, includeHeaders: true);

            var controller = new Controller(readerMock, _viewFactoryMock.Object);

            controller.Process(InputFilepath, "president-2-homeState", "text");

            Assert.That(_renderedResult.TotalCount, Is.EqualTo(recordCount));
            Assert.That(_renderedResult.Records.Count(), Is.EqualTo(1));
            Assert.That(_renderedResult.Records,
                Is.EquivalentTo(readerMock.AccessedRecords.Skip(1+1).Take(1)));
        }
开发者ID:rgavrilov,项目名称:Sogeti,代码行数:14,代码来源:ControllerTest.cs

示例3: Process_FiltersPresdinetsByState

        public void Process_FiltersPresdinetsByState()
        {
            const int recordCount = 3;
            var readerMock = new PresidentsRecordReaderMock(InputFilepath, recordCount);

            var controller = new Controller(readerMock, _viewFactoryMock.Object);

            controller.Process(InputFilepath, "president-2-homeState", "text");

            Assert.That(_renderedResult.TotalCount, Is.EqualTo(recordCount));
            Assert.That(_renderedResult.Records.Count(), Is.EqualTo(1));
            Assert.That(_renderedResult.Records,
                Is.EquivalentTo(readerMock.AccessedRecords.Skip(1).Take(1)));
        }
开发者ID:rgavrilov,项目名称:Sogeti,代码行数:14,代码来源:ControllerTest.cs

示例4: Should_run_task_set

        public void Should_run_task_set()
        {
            var length = 500;
            this.runTaskSet.Expect(x => x.Frequency).Return(length);
            controller = new Controller(this.runTaskSet, sleep, stop, logMock);
            stop.Expect(x => x.ShouldStop()).Return(false).Repeat.Once();
            stop.Expect(x => x.ShouldStop()).Return(true).Repeat.Once();
            sleep.Expect(x => x.SleepSeconds(length));
            this.runTaskSet.Expect(x => x.Process());
            //Test
            controller.Process();

            //Assert
            sleep.VerifyAllExpectations();
            stop.VerifyAllExpectations();
            this.runTaskSet.VerifyAllExpectations();
        }
开发者ID:perryofpeek,项目名称:SqlToGraphite-core,代码行数:17,代码来源:With_controller.cs

示例5: Should_try_controller

 public void Should_try_controller()
 {
     var log = LogManager.GetLogger("log");
     log4net.Config.XmlConfigurator.Configure();
     //var host = "metrics.london.ttldev.local";
     //var port = 2003;
     //var connectionString = "Data Source=nuget.london.ttldev.local;Initial Catalog=GoReportingSvn3;User Id=sa;Password=!bcde1234;";
     //var sqlGetter = new SqlGetter(connectionString, host, port, log);
     //var sql = "SELECT [Assigned],DateDiff(s,[Scheduled],[Assigned]) FROM [GoReportingSvn3].[dbo].[V_BuildStateTransition] where Scheduled > '2012-01-01'";
     //sqlGetter.Process("owain.test.Tlsvn3.Assigned", sql);
     var ds = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.244.127.11)(PORT=1532)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=tracslg2)));User Id=temp_ttl_user;Password=tt1r34dj0b;";
     var taskParam = new TaskParams("ThePath", "SELECT concat(dm_code,concat('_',current_ds_code)) AS dm, COUNT(DISTINCT (d.ID)) AS dm_count FROM DELIVERIES D WHERE d.tr_ID >= (SELECT TR_ID FROM TRANSACTION_FIRSTOFDAY WHERE date_of_tr = TRUNC(SYSDATE)) GROUP BY dm_code, current_ds_code", ds, "Oracle", "name", "graphiteudp");
     var tasks = new List<ITask> { new Task(taskParam, new DataClientFactory(log), new GraphiteClientFactory(log), new GraphiteParams("hostname", 1234), log) };
     var set = new TaskSet(tasks, new Stop(), 1000);
     var sleep = new Sleeper();
     var stop = new Stop();
     var controller = new Controller(set, sleep, stop, log);
     controller.Process();
 }
开发者ID:matthewskelton,项目名称:SqlToGraphite,代码行数:19,代码来源:ManualTests.cs


注:本文中的Controller.Process方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。