Exemplo n.º 1
0
        public void TestMethod3()
        {
            //Arrange
            CustomNumbers <int> numberList = new CustomNumbers <int>();
            int value  = 1;
            int value1 = 2;

            //Act
            numberList.Add(value);
            numberList.Add(value1);
            //Assert
            Assert.AreEqual(value, numberList[0]);
        }
Exemplo n.º 2
0
        public void TestMethod2()
        {
            //Arrange
            CustomNumbers <int> numberList = new CustomNumbers <int>();
            int value  = 4;
            int value1 = 8;

            //Act
            numberList.Add(value);
            //Assert
            Assert.AreEqual(value, value1);
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            //Arrange
            CustomList.CustomNumbers <int>[] numberArrayList = new CustomList.CustomNumbers <int> [8];

            CustomNumbers <int> numberList = new CustomNumbers <int>();
            int value = 4;

            //Act
            numberList.Add(value);
            value = 5;
            //Act
            numberList.Add(value);


            numberArrayList[0] = numberList;



            //Assert
            //Assert.AreEqual(value, numberList[0]);
        }
Exemplo n.º 4
0
        public void TestMethod6()
        {
            //Arrange
            CustomNumbers <int> numberList = new CustomNumbers <int>();

            //Act
            numberList.Add(3);
            numberList.Add(5);
            numberList.Add(8);
            numberList.Add(12);
            numberList.Add(13);
            numberList.Add(16);
            numberList.Add(19);
            numberList.Add(28);

            //Assert
            Assert.AreEqual(3, numberList[5]); //this should fail
        }
Exemplo n.º 5
0
        public void TestMethod9()
        {
            //Arrange
            string expected = "3581213161928";
            CustomNumbers <int> numberList = new CustomNumbers <int>();

            //Act
            numberList.Add(3);
            numberList.Add(5);
            numberList.Add(8);
            numberList.Add(12);
            numberList.Add(13);
            numberList.Add(16);
            numberList.Add(19);
            numberList.Add(28);
            string actual = numberList.ToString();

            //Assert
            Assert.AreEqual(expected, actual); //this should pass
        }