Exemplo n.º 1
0
        public void GetMaxKeyLength_ValidListReturnsLongestKeyLength()
        {
            List <KeyModel> input = new List <KeyModel>
            {
                new KeyModel()
                {
                    Cuts = "123"
                },
                new KeyModel()
                {
                    Cuts = "1234"
                },
                new KeyModel()
                {
                    Cuts = "123456"
                },
                new KeyModel()
                {
                    Cuts = "12345"
                }
            };

            int output = PinningModelBase.GetMaxKeyLength(input);

            Assert.AreEqual(output, 6);
        }
Exemplo n.º 2
0
        public void GetMaxKeyLength_EmptyListReturnsZero()
        {
            List <KeyModel> input = new List <KeyModel>();

            int output = PinningModelBase.GetMaxKeyLength(input);

            Assert.AreEqual(output, 0);
        }
Exemplo n.º 3
0
        public void GetMaxKeyLength_ListOfBlankKeysReturnsZero()
        {
            List <KeyModel> input = new List <KeyModel> {
                new KeyModel(), new KeyModel(), new KeyModel()
            };

            int output = PinningModelBase.GetMaxKeyLength(input);

            Assert.AreEqual(output, 0);
        }