Get() private method

private Get ( int versionId ) : long?
versionId int
return long?
Exemplo n.º 1
0
        public void IndexingHistory_Update()
        {
            var history = new IndexingHistory();
            var historyAcc = new IndexingHistoryAccessor(history);

            for (int size = 5; size < 20; size += 5)
            {
                historyAcc.Initialize(size);

                Assert.IsTrue(history.Count == 0, string.Format("history.Count is {0}, expected: 0 (size: {1})", history.Count, size));

                history.Add(42, 142);
                history.Add(43, 143);

                for (int i = 1111; i < 1122; i+=2)
                {
                    history.Update(42, i);
                    history.Update(43, i + 1);
                    var value42 = history.Get(42);
                    var value43 = history.Get(43);
                    Assert.IsTrue(value42 == i, string.Format("storage[{0}] is {1}, expected: {2} (size: {3})", 42, value42, i, size));
                    Assert.IsTrue(value43 == i + 1, string.Format("storage[{0}] is {1}, expected: {2} (size: {3})", 43, value43, i + 1, size));
                }

                Assert.IsTrue(history.Count == 2, string.Format("history.Count is {0}, expected: 2 (size: {1})", history.Count, size));
            }
        }
Exemplo n.º 2
0
        public void IndexingHistory_Add()
        {
            var history = new IndexingHistory();
            var historyAcc = new IndexingHistoryAccessor(history);

            for (int size = 5; size < 20; size += 5)
            {
                historyAcc.Initialize(size);

                Assert.IsTrue(history.Count == 0, string.Format("history.Count is {0}, expected: 0 (size: {1})", history.Count, size));

                for (int i = 1; i < size + 3; i++)
                    history.Add(i, 100 + i);

                for (int i = 4; i < size + 3; i++)
                {
                    var value = history.Get(i);
                    Assert.IsTrue(value == i + 100, string.Format("storage[{0}] is {1}, expected: {2} (size: {3})", i, value, i + 100, size));
                }

                Assert.IsTrue(history.Count == size, string.Format("history.Count is {0}, expected: {1} (size: {2})", history.Count, size, size));
            }
        }