本文整理汇总了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));
}
示例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)));
}
示例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)));
}
示例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();
}
示例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();
}