コード例 #1
0
        private ConcurrentBidirectionalMap <int, char> CreateMap()
        {
            var map = new ConcurrentBidirectionalMap <int, char>();

            map.Store(1, 'a');
            map.Store(2, 'b');
            map.Store(3, 'c');
            return(map);
        }
コード例 #2
0
        public void TryStoreNewTestMethod()
        {
            var map = new ConcurrentBidirectionalMap <int, char>();

            MapAlteration expected;
            MapAlteration actual;

            expected = MapAlteration.AddedKey | MapAlteration.AddedValue;
            actual   = map.Store(1, 'a');
            Assert.AreEqual(expected, actual, "Add new key/value pair (1=a)");

            expected = MapAlteration.AddedKey | MapAlteration.AddedValue;
            actual   = map.Store(2, 'b');
            Assert.AreEqual(expected, actual, "Add new key/value pair (2=b)");

            expected = MapAlteration.AddedKey | MapAlteration.AddedValue;
            actual   = map.Store(3, 'c');
            Assert.AreEqual(expected, actual, "Add new key/value pair (3=c)");

            Assert.AreEqual <int>(3, map.Count, "Number of entries");
            Assert.IsTrue(map.TestIntegrity());
        }
コード例 #3
0
        public void TestStoreKeyNull()
        {
            var map = new ConcurrentBidirectionalMap <string, string>();

            map.Store(null, "hello");
        }
コード例 #4
0
        public void TestStoreValueNull()
        {
            var map = new ConcurrentBidirectionalMap <string, string>();

            map.Store("hello", null);
        }