本文整理汇总了C#中Counter.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Counter.Get方法的具体用法?C# Counter.Get怎么用?C# Counter.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Counter
的用法示例。
在下文中一共展示了Counter.Get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCounterReset
public void TestCounterReset()
{
using (Counter c = new Counter())
{
GetCounterData()[0].Count = 5;
Assert.AreEqual(5, c.Get());
Assert.IsFalse(GetCounterData()[0].Reset);
c.Reset();
Assert.AreEqual(0, GetCounterData()[0].Count);
Assert.AreEqual(0, c.Get());
Assert.IsTrue(GetCounterData()[0].Reset);
}
}
示例2: TestCounterGet
public void TestCounterGet()
{
using (Counter c = new Counter())
{
GetCounterData()[0].Count = 5;
Assert.AreEqual(5, c.Get());
GetCounterData()[0].Count = 258;
Assert.AreEqual(258, c.Get());
}
}
示例3: TestCounterReset
public void TestCounterReset()
{
using (Counter c = new Counter())
{
HalData()["counter"][0]["count"] = 5;
Assert.AreEqual(5, c.Get());
Assert.IsFalse(HalData()["counter"][0]["reset"]);
c.Reset();
Assert.AreEqual(0, HalData()["counter"][0]["count"]);
Assert.AreEqual(0, c.Get());
Assert.IsTrue(HalData()["counter"][0]["reset"]);
}
}
示例4: TestCounterGet
public void TestCounterGet()
{
using (Counter c = new Counter())
{
HalData()["counter"][0]["count"] = 5;
Assert.AreEqual(5, c.Get());
HalData()["counter"][0]["count"] = 258;
Assert.AreEqual(258, c.Get());
}
}
示例5: Main
static void Main(string[] args)
{
for (var c = new Counter(); c.Get() < 10; c.Inc(1))
Console.WriteLine(c.Get());
Console.ReadLine();
}
示例6: TestAnalogTriggerCounter
public void TestAnalogTriggerCounter()
{
AnalogTrigger trigger = new AnalogTrigger(s_analogIo.GetInput());
trigger.SetLimitsVoltage(2.0f, 3.0f);
Counter counter = new Counter(trigger);
for (int i = 0; i < 50; i++)
{
s_analogIo.GetOutput().SetVoltage(1.0);
Timer.Delay(DelayTime);
s_analogIo.GetOutput().SetVoltage(4.0);
Timer.Delay(DelayTime);
}
Assert.AreEqual(50, counter.Get(), "Analog trigger counter did not count 50 ticks");
counter.Dispose();
trigger.Dispose();
}