Ejemplo n.º 1
0
        public void PadColumns_ValidInputReturnsColumnsOfSameHeight()
        {
            List <List <int?> > input = new List <List <int?> >
            {
                new List <int?> {
                    1, 2, 3
                },
                new List <int?> {
                    1, 2, 3, 4, 5
                },
                new List <int?> {
                    1, 2
                }
            };

            List <List <int?> > output = PinningModelBase.PadColumns(input);

            for (int index = 0; index < output.Count; index++)
            {
                List <int?> currentColumn = output[index];

                if (currentColumn.Count != 5)
                {
                    Assert.Fail($"Column at index {index} was height {currentColumn.Count} instead of expected 5.");
                }
            }
        }
Ejemplo n.º 2
0
        public void PadColumns_EmptyInputReturnsEmptyOutput()
        {
            List <List <int?> > input = new List <List <int?> >();

            List <List <int?> > output = PinningModelBase.PadColumns(input);

            Assert.AreEqual(output.Count, 0);
        }
Ejemplo n.º 3
0
        public void PadColumns_ValidInputReturnsSameNumberOfColumns()
        {
            List <List <int?> > input = new List <List <int?> >
            {
                new List <int?> {
                    1, 2, 3
                },
                new List <int?> {
                    1, 2, 3, 4, 5
                },
                new List <int?> {
                    1, 2
                }
            };

            List <List <int?> > output = PinningModelBase.PadColumns(input);

            if (output.Count != input.Count)
            {
                Assert.Fail($"Output had {output.Count} columns instead of expected {input.Count}.");
            }
        }