本文整理汇总了C#中Station.ClaimChannel方法的典型用法代码示例。如果您正苦于以下问题:C# Station.ClaimChannel方法的具体用法?C# Station.ClaimChannel怎么用?C# Station.ClaimChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Station
的用法示例。
在下文中一共展示了Station.ClaimChannel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StationIsCreatedWithCorrectNumberOfChannels
public void StationIsCreatedWithCorrectNumberOfChannels()
{
var st = new Station( 2, 0, 1, 1 );
Assert.AreEqual( 0, st.CurrentBusyChannels );
Assert.IsTrue( st.ClaimChannel( false ) );
Assert.AreEqual( 1, st.CurrentBusyChannels );
Assert.IsTrue( st.ClaimChannel( false ) );
Assert.AreEqual( 2, st.CurrentBusyChannels );
Assert.IsFalse( st.ClaimChannel( false ) );
st.ReleaseChannel();
st.ReleaseChannel();
Assert.AreEqual( 0, st.CurrentBusyChannels );
}
示例2: TestHandoverEventActionCallHandover
public void TestHandoverEventActionCallHandover()
{
int dropped = 0;
int createdhandover = 0;
int createdend = 0;
var data = new CallData( 1, 5, 20, 0 );
var tostation = new Station( 1, 0, 10, 10 );
var fromstation = new Station( 1, 0, 0, 10 );
fromstation.ClaimChannel( true );
var e = new HandoverEvent(
fromstation,
tostation,
() => { dropped++; },
( d, cd ) => { createdend++; },
( d, cd ) =>
{
createdhandover++;
Assert.AreEqual( data, cd );
Assert.AreEqual( (uint) 15, d );
},
5,
data );
e.Action();
Assert.AreEqual( 0, dropped );
Assert.AreEqual( 0, createdend );
Assert.AreEqual( 1, createdhandover );
}