public void Indexer_03()
        {
            // Arrange
            var list = new LimitList <int>(3);

            // Act/Assert
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => list[1] = 10);
        }
        public void AddLast_01()
        {
            // Arrange
            var list = new LimitList <int>(3);

            // Act
            list.AddLast(1);
            list.AddLast(2);

            // Assert
            CollectionAssert.AreEquivalent(new int[] { 1, 2 }, list.ToList());
        }
예제 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            LimitList _limitList = LimitList.GetLimitList();

            limitIDComboBox.DataSource = _limitList;

            TipList _tipList = TipList.GetTipList();

            tipIDComboBox.DataSource = _tipList;

            teleInfoBindingSource.DataSource = _newTele;
        }
예제 #4
0
        public void AddLast_01()
        {
            // Arrange
            var list = new LimitList <int>(3);

            // Act
            list.AddLast(1);
            list.AddLast(2);

            // Assert
            Assert.Equal(new int[] { 1, 2 }, list.ToList());
        }
        public void Indexer_01()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);

            // Act
            list[0] = 10;

            // Assert
            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(10, list[0]);
        }
        public void Contains_02()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);
            list.AddLast(2);

            // Act
            var result = list.Contains(3);

            // Assert
            Assert.AreEqual(false, result);
        }
        public void Count_01()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);
            list.AddLast(2);

            // Act
            var count = list.Count;

            // Assert
            Assert.AreEqual(2, count);
        }
예제 #8
0
        public void AddFirst_02()
        {
            // Arrange
            var list = new LimitList <int>(3);

            // Act
            list.AddFirst(1);
            list.AddFirst(2);
            list.AddFirst(3);
            list.AddFirst(4);

            // Assert
            Assert.Equal(new int[] { 4, 3, 2 }, list.ToList());
        }
예제 #9
0
        public void Contains_01()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);
            list.AddLast(2);

            // Act
            var result = list.Contains(2);

            // Assert
            Assert.True(result);
        }
        public void IndexOf_01()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);
            list.AddLast(2);
            list.AddLast(3);

            // Act
            var index = list.IndexOf(2);

            // Assert
            Assert.AreEqual(1, index);
        }
        public void Remove_03()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);

            // Act
            var result = list.Remove(4);

            // Assert
            Assert.AreEqual(false, result);
            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(1, list[0]);
        }
예제 #12
0
        public void Remove_03()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);

            // Act
            var result = list.Remove(4);

            // Assert
            Assert.False(result);
            Assert.Single(list);
            Assert.Equal(1, list[0]);
        }
        public void RemoveAt()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);
            list.AddLast(2);
            list.AddLast(3);

            // Act
            list.RemoveAt(1);

            // Assert
            Assert.AreEqual(2, list.Count);
            Assert.AreEqual(1, list[0]);
            Assert.AreEqual(3, list[1]);
        }
        public void Remove_02()
        {
            // Arrange
            var list = new LimitList <int>(3);

            list.AddLast(1);
            list.AddLast(2);
            list.AddLast(3);

            // Act
            var result = list.Remove(2);

            // Assert
            Assert.AreEqual(true, result);
            Assert.AreEqual(2, list.Count);
            Assert.AreEqual(1, list[0]);
            Assert.AreEqual(3, list[1]);
        }