コード例 #1
0
        public void Convert_Incompatible_Returns_Empty()
        {
            List <int> originalList = new List <int>()
            {
                1, 2, 3, 4, 5
            };
            List <char> convertedList = new List <char>(ListLibrary.Convert <int, char>(originalList));

            Assert.IsEmpty(convertedList);
        }
コード例 #2
0
        public void Convert_Compatible_Returns_Converted_List()
        {
            List <ClassForConversion> listToConvert = new List <ClassForConversion>()
            {
                new ClassForConversion(),
                new ClassForConversion(),
                new ClassForConversion()
            };
            List <BaseForConversion> convertedList = new List <BaseForConversion>(ListLibrary.Convert <ClassForConversion, BaseForConversion>(listToConvert));

            Assert.IsTrue(listToConvert.Count == convertedList.Count);
        }
コード例 #3
0
        public void Convert_Given_Null_Returns_Empty()
        {
            List <char> convertedList = new List <char>(ListLibrary.Convert <string, char>(null));

            Assert.IsEmpty(convertedList);
        }