本文整理汇总了C#中Task.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Task.ToString方法的具体用法?C# Task.ToString怎么用?C# Task.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompletedDate
public void CompletedDate()
{
var task1 = new Task("x 2011-03-01 2010-12-31 This task should be completed");
Assert.IsTrue(task1.CompletedDate != null);
Assert.AreEqual(new DateTime(2011, 3, 1), task1.CompletedDate);
var task2 = new Task("2010-12-31 This task should not be completed");
Assert.IsNull(task2.CompletedDate);
var task3 = new Task(task1.ToString());
Assert.IsTrue(task3.CompletedDate != null);
Assert.AreEqual(new DateTime(2011, 3, 1), task3.CompletedDate);
}
示例2: AddTask
public void AddTask(Task task) {
Debug.Log("Added Task " + task.ToString());
tasks.AddLast(task);
tasksLeft.AddLast(task);
}
示例3: ToString_From_Parameters
public void ToString_From_Parameters()
{
var task = new Task("(A)", _projects, _contexts, "This is a test task");
Assert.AreEqual("(A) This is a test task @work +test", task.ToString());
}
示例4: ToString_From_Raw
public void ToString_From_Raw()
{
var task = new Task("(A) @work +test This is a test task");
Assert.AreEqual("(A) @work +test This is a test task", task.ToString());
}
示例5: getStatusString
public string getStatusString(Task runningTask)
{
string str = string.Empty;
switch (runningTask)
{
case Task.Idle:
str = runningTask.ToString();
break;
case Task.SetVoltage:
str = "Setting voltage";
break;
case Task.ReadCurrent:
str = "Reading current";
break;
case Task.Reset:
str = "Software reset";
break;
case Task.IdentifyStart:
case Task.IdentifyStop:
str = "Identifying the device";
break;
case Task.Update:
str = "Sending update commands";
break;
case Task.ReadPartFuncInfo:
case Task.ReadInterruptStatus:
case Task.ReadPhStatus:
case Task.ReadModemPackStatus:
case Task.ReadChipStatus:
case Task.ReadFfr:
str = "Reading status";
break;
case Task.InitTxFifo:
str = "Initializing TX buffer";
break;
case Task.InitRxFifo:
str = "Initializing RX buffer";
break;
case Task.LoadTxFifo:
str = "Loading data into TX buffer";
break;
case Task.StartTX:
str = "Starting TX buffer transmission";
break;
case Task.StartRX:
str = "Reading RX buffer";
break;
case Task.PER:
str = "Running PER test";
break;
case Task.ACK:
str = Task.Idle.ToString();
break;
case Task.NACK:
str = Task.Idle.ToString();
break;
default:
str = "Doing unknown process!";
break;
}
return ("Status: " + str);
}
示例6: TestTaskToStringWithNullName
public void TestTaskToStringWithNullName()
{
var p = new Task();
p.Name = null;
Assert.AreEqual(p.ToString(), "BrockSolutions.Ticker.Shared.Task"); //Default representation from base object
}
示例7: TestTaskToStringWithName
public void TestTaskToStringWithName()
{
var name = "Test Name";
var p = new Task() { Name = name };
Assert.AreEqual(p.ToString(), name);
}