コード例 #1
0
        public void op_GetEnumerator()
        {
            IEnumerable obj = new MultitonCollection <int, DateTime>();

            Assert.NotNull(obj.GetEnumerator());

            Assert.NotNull(new MultitonCollection <int, DateTime>().GetEnumerator());
        }
コード例 #2
0
        public void op_Add_TKey_TValue()
        {
            var obj = new MultitonCollection <int, DateTime>();

            Assert.Equal(0, obj.Count());

            obj.Add(123, DateTime.Today);

            Assert.Equal(1, obj.Count());
        }
コード例 #3
0
        public void indexer_TKey_getAdd()
        {
            var expected = DateTime.MinValue;

            var obj = new MultitonCollection <int, DateTime>();

            var actual = obj[123];

            Assert.Equal(expected, actual);
        }
コード例 #4
0
        public void op_GetValue_TKey()
        {
            var obj = new MultitonCollection <int, string>();

            const string expected = "example";

            obj.Add(123, expected);

            Assert.Equal(expected, obj.GetValue(123));
        }
コード例 #5
0
        public void op_ContainsKey_TKey()
        {
            var obj = new MultitonCollection <int, DateTime>
            {
                {
                    123, DateTime.Today
                }
            };

            Assert.True(obj.ContainsKey(123));
        }
コード例 #6
0
        public void indexer_TKey_setAdd()
        {
            const string expected = "example";

            var obj = new MultitonCollection <int, string>();

            obj[123] = expected;

            var actual = obj[123];

            Assert.Equal(expected, actual);
        }
コード例 #7
0
        public void indexer_TKey_get()
        {
            const string expected = "example";

            var obj = new MultitonCollection <int, string>
            {
                {
                    123, expected
                }
            };

            var actual = obj[123];

            Assert.Equal(expected, actual);
        }