Exemplo n.º 1
0
        public void AddRow_When_Called_Multiple_Times_Adds_Multiple_Rows()
        {
            //Arrange
            var frame = new BasicFrame(Guid.NewGuid());

            TableGenerator.AddColum(frame, typeof(int), 1);
            TableGenerator.AddColum(frame, typeof(double), 1.1);
            TableGenerator.AddColum(frame, typeof(string), "");

            object[] values0 = new object[3];
            values0[0] = 111;
            values0[1] = 11.0;
            values0[2] = "lalala";

            object[] values1 = new object[3];
            values1[0] = 222;
            values1[1] = 12.0;
            values1[2] = "rfrfrf";

            object[] values2 = new object[3];
            values2[0] = 333;
            values2[1] = 13.0;
            values2[2] = "hhhhhhh";

            //Act
            int index0 = frame.AddRow(values0);
            int index1 = frame.AddRow(values1);
            int index2 = frame.AddRow(values2);

            //Assert
            Assert.Equal(3, frame.RowCount);
        }
Exemplo n.º 2
0
        public void AddRow_Adds_A_New_Row_To_Frame()
        {
            //Arrange
            var frame = new BasicFrame(Guid.NewGuid());

            TableGenerator.AddColum(frame, typeof(int), 1);
            TableGenerator.AddColum(frame, typeof(double), 1.1);
            TableGenerator.AddColum(frame, typeof(string), "");

            object[] values = new object[3];
            values[0] = 33;
            values[1] = 13.0;
            values[2] = "lalala";

            //Act
            frame.AddRow(values);

            //Assert
            Assert.Equal(1, frame.RowCount);
        }
Exemplo n.º 3
0
        public void AddRow_With_Incorrect_Input_Array_Length_Adds_Default_Values_For_Empty_Columns()
        {
            //Arrange
            var frame = new BasicFrame(Guid.NewGuid());

            TableGenerator.AddColum(frame, typeof(int), 1);
            TableGenerator.AddColum(frame, typeof(double), 1.1);
            TableGenerator.AddColum(frame, typeof(string), "");

            object[] values = new object[3];
            values[0] = 33.0;
            values[1] = 13;

            //Act
            frame.AddRow(values);

            //Assert
            Assert.Equal(1, frame.RowCount);
        }
Exemplo n.º 4
0
        public void RemoveRow_Removes_The_Row_At_The_Specified_Row_Index()
        {
            //Arrange
            var frame = new BasicFrame(Guid.NewGuid());

            TableGenerator.AddColum(frame, typeof(int), 1);
            TableGenerator.AddColum(frame, typeof(double), 1.1);
            TableGenerator.AddColum(frame, typeof(string), "");

            object[] values0 = new object[3];
            values0[0] = 111;
            values0[1] = 11.0;
            values0[2] = "lalala";

            object[] values1 = new object[3];
            values1[0] = 222;
            values1[1] = 12.0;
            values1[2] = "rfrfrf";

            object[] values2 = new object[3];
            values2[0] = 333;
            values2[1] = 13.0;
            values2[2] = "hhhhhhh";

            int index0 = frame.AddRow(values0);
            int index1 = frame.AddRow(values1);
            int index2 = frame.AddRow(values2);

            //Act
            frame.Rows.RemoveAt(index1);

            //Assert
            Assert.Equal(2, frame.RowCount);
        }