示例#1
0
        public void AddCompactSpan_SetConnection_Success()
        {
            CompactSpan cs = new CompactSpan(10, int.MaxValue);

            CompactSpan.SetConnection((Direction)1, 1, ref cs);

            Assert.AreEqual(cs.ConnectionCount, 1);
        }
示例#2
0
        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));
        }
示例#3
0
        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);
        }
示例#4
0
        public void SetConnection_InvalidDirection_Success()
        {
            CompactSpan cs = new CompactSpan(10, int.MaxValue);

            Assert.Throws <ArgumentException>(() => CompactSpan.SetConnection((Direction)(-1), 1, ref cs));
        }
示例#5
0
        public void SetConnection_TooHigh_Success()
        {
            CompactSpan cs = new CompactSpan(10, int.MaxValue);

            Assert.Throws <ArgumentOutOfRangeException>(() => CompactSpan.SetConnection((Direction)2, 300, ref cs));
        }