Exemple #1
0
        public void FindFirstElementInIEnumeratorTest2()
        {
            CommaSeperatedUtils target = new CommaSeperatedUtils();
            List <string>       source = new List <string>();

            source.Add("Item1");
            source.Add("Item2");
            object expected = "Item1";
            object actual;

            actual = target.FindFirstElementInIEnumerator(source);
            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void FindFirstElementInIEnumeratorTest()
        {
            CommaSeperatedUtils target = new CommaSeperatedUtils();
            IEnumerable         source = new Dictionary <string, object>();
            object expected            = null;
            object actual;

            try
            {
                actual = target.FindFirstElementInIEnumerator(source);
                Assert.AreEqual(expected, actual);
            }
            catch (DesignByContractException)
            {
            }
            catch (Exception)
            {
                Assert.Fail();
            }
        }
Exemple #3
0
        public void FindFirstElementInIEnumeratorTest3()
        {
            CommaSeperatedUtils     target = new CommaSeperatedUtils();
            List <ComplexStructure> source = new List <ComplexStructure>();
            ComplexStructure        c1     = new ComplexStructure()
            {
                Field1 = "F1", Field2 = Guid.NewGuid()
            };
            ComplexStructure c2 = new ComplexStructure()
            {
                Field1 = "F1", Field2 = Guid.NewGuid()
            };

            source.Add(c1);
            source.Add(c2);
            object expected = c1;
            object actual;

            actual = target.FindFirstElementInIEnumerator(source);
            Assert.AreEqual(expected, actual);
        }