public void AddCompactSpan_SetConnection_Success() { CompactSpan cs = new CompactSpan(10, int.MaxValue); CompactSpan.SetConnection((Direction)1, 1, ref cs); Assert.AreEqual(cs.ConnectionCount, 1); }
public void AddCompactSpan_IsConnected_Success() { CompactSpan cs = new CompactSpan(10, int.MaxValue); CompactSpan.SetConnection(Direction.East, 1, ref cs); Assert.IsTrue(cs.IsConnected(Direction.East)); Assert.IsFalse(cs.IsConnected(Direction.West)); }
public void AddCompactSpan_GetConnection_Success() { CompactSpan cs = new CompactSpan(10, int.MaxValue); CompactSpan.SetConnection((Direction)1, 50, ref cs); Assert.AreEqual(CompactSpan.GetConnection(ref cs, (Direction)1), 50); Assert.AreEqual(cs.GetConnection((Direction)1), 50); }
public void SetConnection_InvalidDirection_Success() { CompactSpan cs = new CompactSpan(10, int.MaxValue); Assert.Throws <ArgumentException>(() => CompactSpan.SetConnection((Direction)(-1), 1, ref cs)); }
public void SetConnection_TooHigh_Success() { CompactSpan cs = new CompactSpan(10, int.MaxValue); Assert.Throws <ArgumentOutOfRangeException>(() => CompactSpan.SetConnection((Direction)2, 300, ref cs)); }