本文整理汇总了C#中Track.AddBall方法的典型用法代码示例。如果您正苦于以下问题:C# Track.AddBall方法的具体用法?C# Track.AddBall怎么用?C# Track.AddBall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Track
的用法示例。
在下文中一共展示了Track.AddBall方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReturnsToQueueInReverseOrder
public void ReturnsToQueueInReverseOrder()
{
var queue = new Queue<int>();
var hourTrack = new Track(queue, 2);
hourTrack.AddBall(1);
hourTrack.AddBall(2);
hourTrack.AddBall(3);
Assert.AreEqual(0, hourTrack.Length);
Assert.AreEqual(2, queue.First());
Assert.AreEqual(3, queue.Last());
}
示例2: ReturnsToQueueInReverseOrderAndAddsBallToNextQueue
public void ReturnsToQueueInReverseOrderAndAddsBallToNextQueue()
{
var queue = new Queue<int>();
var hourTrack = new Track(queue, 2);
var minuteTrack = new Track(queue, 2, hourTrack);
minuteTrack.AddBall(1);
minuteTrack.AddBall(2);
minuteTrack.AddBall(3);
Assert.AreEqual(0, minuteTrack.Length);
Assert.AreEqual(1, hourTrack.Length);
Assert.AreEqual(3, hourTrack.First());
Assert.AreEqual(2, queue.First());
Assert.AreEqual(1, queue.Last());
}
示例3: IsFull
public void IsFull()
{
var track = new Track(null, 1);
track.AddBall(1);
Assert.IsTrue(track.IsFull());
}
示例4: CanAddBallToTrack
public void CanAddBallToTrack()
{
var track = new Track(null, 5);
track.AddBall(1);
Assert.AreEqual(1, track.Length);
}