public void Color_Update_WithIdNotNull_True() { IService <Color> colorService = new ColorService(); Color newColor = new Color(1003, "Vitalic333"); colorService.Create(newColor); Color crColor = colorService.GetById(333); Color modColor = new Color(1003, "Vitalic1333"); colorService.Update(modColor); Color updColor = colorService.GetById(1003); Assert.AreEqual(crColor.id, updColor.id); Assert.AreNotEqual(crColor.color, updColor.color); }
public void Color_GetById_IsIdNotExist_Null() { const int id = 22220; IService <Color> colorService = new ColorService(); Assert.IsNull(colorService.GetById(id)); }
public void Color_GetById_IsIdExist_Obj() { IService <Color> colorService = new ColorService(); Color newColor = new Color(1002, "First"); colorService.Create(newColor); Assert.IsNotNull(colorService.GetById(newColor.id)); }
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(); }