Esempio n. 1
0
        public void Contains_DoesNotContain_IsFalse()
        {
            // arrange
            var list = new MappedList(_testMap);

            list.SetValues(_testValues);

            // act
            var result = list.Contains("bat");

            // assert
            Assert.False(result);
        }
Esempio n. 2
0
        public void Contains_DoesContain_IsTrue()
        {
            // arrange
            var list = new MappedList(_testMap);

            list.SetValues(_testValues);

            // act
            var result = list.Contains("foo");

            // assert
            Assert.True(result);
        }
Esempio n. 3
0
        public void Count_ReturnsCount()
        {
            // arrange
            var list = new MappedList(_testMap);

            list.SetValues(_testValues);

            // act
            var count = list.Count;

            // assert
            Assert.Equal(_testValues.Length, count);
        }
Esempio n. 4
0
        public void Index_FirstIsLast()
        {
            // arrange
            var list = new MappedList(_testMap);

            list.SetValues(_testValues);

            // act
            var value = list[0];

            // assert
            Assert.Equal("baz", value);
        }
Esempio n. 5
0
        public void Foreach_ListIsBackwards()
        {
            // arrange
            var expected = new[] { "baz", "bar", "foo" };
            var list     = new MappedList(_testMap);

            list.SetValues(_testValues);

            // act
            var output = new List <string>();

            foreach (var value in list)
            {
                output.Add(value);
            }

            // assert
            var asArray = output.ToArray();

            Assert.Equal(expected, asArray);
        }