Example #1
0
        public void ConvertListToObservableCollection_Of_List_Of_String_Returns_Expected()
        {
            List <string> listToConvert = new List <string>()
            {
                "Foo", "bar", "Moo", "nar"
            };
            ObservableCollection <string> convertedList = ListLibrary.ConvertListToObservableCollection <string>(listToConvert);

            Assert.IsTrue(convertedList.Count == listToConvert.Count);
            Assert.AreEqual(listToConvert[0], convertedList[0]);
            Assert.AreEqual(listToConvert[1], convertedList[1]);
            Assert.AreEqual(listToConvert[2], convertedList[2]);
            Assert.AreEqual(listToConvert[3], convertedList[3]);
        }
Example #2
0
        public void ConvertListToObservableCollection_Of_Collection_Of_Double_Returns_Expected()
        {
            List <double> listToConvert = new List <double>()
            {
                1, 2.2, 999, -4
            };
            ObservableCollection <double> convertedList = ListLibrary.ConvertListToObservableCollection <double>(listToConvert);

            Assert.IsTrue(convertedList.Count == listToConvert.Count);
            Assert.AreEqual(listToConvert[0], convertedList[0]);
            Assert.AreEqual(listToConvert[1], convertedList[1]);
            Assert.AreEqual(listToConvert[2], convertedList[2]);
            Assert.AreEqual(listToConvert[3], convertedList[3]);
        }
Example #3
0
        public void ConvertListToObservableCollection_Given_Null_Returns_Empty()
        {
            ObservableCollection <string> convertedList = ListLibrary.ConvertListToObservableCollection <string>(null);

            Assert.IsEmpty(convertedList);
        }