Ejemplo n.º 1
0
        public void Color_Create_WithIdNotNull_True()
        {
            IService <Color> colorService = new ColorService();
            int   countBefore             = colorService.GetListAll().Count;
            Color newColor = new Color(999, "Vitalic");

            colorService.Create(newColor);
            int countAfter = colorService.GetListAll().Count;

            Assert.AreNotEqual(countBefore, countAfter);
        }
Ejemplo n.º 2
0
        public void Color_DeleteById_WithIdNotNull_True()
        {
            IService <Color> colorService = new ColorService();
            Color            newColor     = new Color(1004, "Vitalic");

            colorService.Create(newColor);
            int countBefore = colorService.GetListAll().Count;

            colorService.DeleteById(1004);
            int countAfter = colorService.GetListAll().Count;

            Assert.IsTrue(countBefore > countAfter);
        }
Ejemplo n.º 3
0
        public void Color_GetListAll_NotEmpty_ReturnCollection()
        {
            IService <Color> colorService  = new ColorService();
            Color            newColorFirst = new Color(1001, "First");

            colorService.Create(newColorFirst);
            Assert.IsTrue(colorService.GetListAll().Count > 0);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            IService <Color> colorService = new ColorService();

            Color newColor = new Color(33, "Vitalic");
            //colorService.Create(newColor);

            //colorService.DeleteById(0);

            Color dsdsf = new Color(33, "555");
            //colorService.Update(dsdsf);

            var listColorsById = colorService.GetById(33);

            Console.WriteLine(listColorsById);

            ICollection <Color> listColors = colorService.GetListAll();

            foreach (var l in listColors)
            {
                Console.WriteLine(l);
            }
            Console.ReadKey();
        }