Exemplo n.º 1
0
        public void Addr_WithNegativeIndex_ThrowException()
        {
            // arrange
            var layout     = new Layout(new[] { 3, 4 }, 5, new[] { 4, 1 });
            var fastAccess = new FastAccess(layout);

            // action
            var _ = fastAccess.Addr(new[] { -1, 0 });
        }
Exemplo n.º 2
0
        public void Addr_OutOfRange_ThrowException()
        {
            // arrange
            var layout     = new Layout(new[] { 3, 4 }, 5, new[] { 4, 1 });
            var fastAccess = new FastAccess(layout);

            // action
            var _ = fastAccess.Addr(new[] { 10, 0 });
        }
Exemplo n.º 3
0
        public void Addr_WithInvalidLength_ThrowException()
        {
            // arrange
            var layout     = new Layout(new[] { 3, 4 }, 0, new[] { 4, 1 });
            var fastAccess = new FastAccess(layout);

            // action
            var _ = fastAccess.Addr(new[] { 2 });
        }
Exemplo n.º 4
0
        public void Addr_ValidIndex_ReturnOffset()
        {
            // arrange
            var layout     = new Layout(new[] { 3, 4 }, 5, new[] { 4, 1 });
            var fastAccess = new FastAccess(layout);

            // action
            var addr = fastAccess.Addr(new[] { 1, 1 });

            // Assert
            Assert.AreEqual(10, addr);
        }