Пример #1
0
        public void GetPaddedKeys_ReturnedKeysAllHaveSameLength()
        {
            List <KeyModel> input = new List <KeyModel>
            {
                new KeyModel()
                {
                    Cuts = "123456"
                },
                new KeyModel()
                {
                    Cuts = "1234"
                },
                new KeyModel()
                {
                    Cuts = "12345678"
                }
            };

            List <List <int?> > output = PinningModelBase.GetPaddedKeys(input, 6);

            for (int index = 0; index < output.Count; index++)
            {
                int currentLength = output[index].Count;

                if (currentLength != 6)
                {
                    Assert.Fail($"Result at index {index} had length {currentLength} instead of 6.");
                }
            }
        }
Пример #2
0
        public void GetPaddedKeys_EmptyInputListReturnsEmptyOutputList()
        {
            List <KeyModel> input = new List <KeyModel>();

            List <List <int?> > output = PinningModelBase.GetPaddedKeys(input, 5);

            if (output.Count != 0)
            {
                Assert.Fail($"Output count was {output.Count} instead of zero.");
            }
        }