Ejemplo n.º 1
0
 public void AddInvalidObjectTest()
 {
     Assert.That(() =>
     {
         _list.Add(new InvalidClass());
     }, Throws.ArgumentException);
 }
Ejemplo n.º 2
0
        public void TestToString()
        {
            // Arrage
            ListClass <string> list = new ListClass <string>();

            // Act
            list.Add("Hello");
            list.Add("World");
            // Assert
            Assert.AreEqual("HelloWorld", list.ToString());
        }
Ejemplo n.º 3
0
        public void AddOnTest()
        {
            // Arrange
            ListClass <int> list = new ListClass <int>();
            int             one  = 1;

            // Act
            list.Add(one);
            int two = list.listArray[0];

            // Assert
            Assert.AreEqual(one, two);
        }
Ejemplo n.º 4
0
        public void Add_FiveValues_ReturnsValueAtIndex()
        {
            // Arrage
            ListClass <int> list = new ListClass <int>()
            {
                0, 1, 2, 3
            };
            int input = 7;

            // Act
            list.Add(input);
            //Assert
            Assert.AreEqual(7, list.listArray[4]);
        }
Ejemplo n.º 5
0
        public void AddLength()
        {
            // Arrage
            ListClass <int> list = new ListClass <int>()
            {
                0, 1, 2, 3
            };
            int input = 4;

            // Act
            list.Add(input);
            //Assert
            Assert.AreEqual(5, list.Counts);
        }
Ejemplo n.º 6
0
        public void AddOnTwoTest()
        {
            // Arrange
            ListClass <int> list = new ListClass <int>()
            {
                0, 2, 3
            };
            int one = 1;

            // Act
            list.Add(one);
            // Assert
            Assert.AreEqual(list.listArray[3], one);
        }