Esempio n. 1
0
        public void GetFirstItem_GoodCollection_FAIL()
        {
            IEnumerable <string> colec = new List <string>()
            {
                "Hola"
            };
            object expect = 1.GetType();

            object result = ToDataTableActions.GetFirstItem(colec);

            Assert.IsFalse(result == expect, "Ha fallado GetFirstItem_GoodCollection_FAIL, el tipo de la coleción no es el mismo ");
        }
Esempio n. 2
0
        public void GetType_GoodCollection_OK()
        {
            IEnumerable <string> colec = new List <string>()
            {
                "Hola"
            };
            Type expect = "Hola".GetType();

            Type result = ToDataTableActions.GetTypeItems(colec);

            Assert.IsTrue(result == expect, "Ha fallado GetType_GoodCollection_OK, el tipo de la coleción no es el mismo ");
        }
Esempio n. 3
0
        public void IsSimpleItem_GoodCollection_FAIL()
        {
            IEnumerable <object> colec = new List <object>()
            {
                new Viewer(new System.Data.DataTable())
            };
            bool expect = true;

            foreach (var obj in colec)
            {
                bool result = ToDataTableActions.IsSimpleItem(new List <object>()
                {
                    obj
                });

                Assert.IsFalse(result == expect, "Fallo al comprobar si es dato simple");
            }
        }
Esempio n. 4
0
        public void IsSimpleItem_GoodCollection_OK()
        {
            IEnumerable <object> colec = new List <object>()
            {
                "Hola", 10, 10.1m, DateTime.Today, new int?(1), DayOfWeek.Friday
            };
            bool expect = true;

            foreach (var obj in colec)
            {
                bool result = ToDataTableActions.IsSimpleItem(new List <object>()
                {
                    obj
                });

                Assert.IsTrue(result == expect, "Fallo al comprobar si es dato simple");
            }
        }