예제 #1
0
        public void GetSortedCuts_EmptyInputReturnsEmptyOutput()
        {
            List <List <int?> > input = new List <List <int?> >();

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

            Assert.AreEqual(output.Count, 0);
        }
예제 #2
0
        public void GetSortedCuts_UnequalLengthKeysThrowsException()
        {
            List <List <int?> > input = new List <List <int?> >
            {
                new List <int?> {
                    1, 2, 3, 4, 5, 6
                },
                new List <int?> {
                    4, 3, 5, 1, 2
                }
            };

            Assert.ThrowsException <ArgumentException>(() => { PinningModelBase.GetSortedCuts(input); });
        }
예제 #3
0
        public void GetSortedCuts_ValidInputReturnsSameNumberOfColumnsAsKeyLength()
        {
            List <List <int?> > input = new List <List <int?> >
            {
                new List <int?> {
                    1, 2, 3, 4, 5, 6
                },
                new List <int?> {
                    4, 3, 5, 1, 2, 7
                },
                new List <int?> {
                    1, 3, 3, null, 2, 7
                },
                new List <int?> {
                    5, 1, 6, 3, 1, 2
                }
            };

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

            Assert.AreEqual(output.Count, input[0].Count);
        }