public void Delete() { ACAD food = new CADType("GebatDataConnectionString"); DataRow del = food.GetVoidRow; del["Id"] = 1; del["Name"] = "Kg"; food.Delete(del); }
/// <summary> /// Inicializa el tipo con el nombre. /// </summary> /// <param name="name">Nombre del tipo.</param> public ENType(string name) { if (name == null) { throw new NullReferenceException("The name cannot be null"); } cad = new CADType ("GebatDataConnectionString"); this.name = name; }
public void SelectWhereInvalidStart() { ACAD food = new CADType("GebatDataConnectionString"); food.SelectWhere("Name = 'Kg'", -3); }
public void SelectWhereFailConn() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); food.SelectWhere("Name = 'Kg'"); }
private ENType() : base() { cad = new CADType ("GebatDataConnectionString"); name = ""; }
public void UpdateFailConn() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); DataRow ins = food.GetVoidRow; ins["Id"] = 1; ins["Name"] = "Cajas"; food.Update(ins); }
public void TestSelectOne() { string expected = "Kg"; ACAD food = new CADType("GebatDataConnectionString"); List<object> ids = new List<object>(); ids.Add((int)1); DataRow actual = food.Select(ids); Assert.AreEqual(actual["Name"].ToString(), expected); }
public void TestLast() { ACAD food = new CADType("GebatDataConnectionString"); DataRow actual = food.Last(); DataRow expected = food.GetVoidRow; expected ["Id"] = 4; expected ["Name"] = "Paquetes"; Assert.AreEqual(expected["Id"], actual["Id"]); Assert.AreEqual(expected["Name"], actual["Name"]); }
public void SelectAll() { ACAD food = new CADType("GebatDataConnectionString"); DataTable actual = food.SelectAll(); DataTable expected = this.tableFormat; DataRow row = expected.NewRow(); row["Id"] = 1; row["Name"] = "Kg"; expected.Rows.Add(row); DataRow row2 = expected.NewRow(); row2["Id"] = 2; row2["Name"] = "Litros"; expected.Rows.Add(row2); DataRow row3 = expected.NewRow(); row3["Id"] = 4; row3["Name"] = "Paquetes"; expected.Rows.Add(row3); for (int i = 0; i < expected.Rows.Count; i++) { Assert.AreEqual(expected.Rows[i]["Id"], actual.Rows[i]["Id"]); Assert.AreEqual(expected.Rows[i]["Name"], actual.Rows[i]["Name"]); } }
public void Select() { ACAD food = new CADType("GebatDataConnectionString"); List<object> ids = new List<object>(); ids.Add(1); DataRow actual = food.Select(ids); DataTable table = tableFormat; DataRow expected = table.NewRow(); expected["Id"] = 1; expected["Name"] = "Kg"; Assert.AreEqual(expected["Id"], actual["Id"]); Assert.AreEqual(expected["Name"], actual["Name"]); }
public void InsertNullRow() { ACAD food = new CADType("GebatDataConnectionString"); DataRow ins = null; food.Insert(ins); }
public void InsertFailCOnn() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); DataRow ins = food.GetVoidRow; ins["Name"] = "Cajas"; food.Insert(ins); }
public void Insert() { ACAD food = new CADType("GebatDataConnectionString"); DataRow ins = food.GetVoidRow; ins["Name"] = "Cajas"; DataRow expected = food.GetVoidRow; expected ["Id"] = 5; expected ["Name"] = "Cajas"; DataRow actual = food.Insert(ins); Assert.AreEqual(expected["Id"], actual["Id"]); Assert.AreEqual(expected["Name"], actual["Name"]); }
public void DeleteWrongRow() { ACAD food = new CADType("GebatDataConnectionString"); DataRow del = food.GetVoidRow; del["Name"] = new ENType("taca"); food.Delete(del); }
public void DeleteNullRow() { ACAD food = new CADType("GebatDataConnectionString"); food.Delete(null); }
public void SelectWjereInvalidStatement() { ACAD food = new CADType("GebatDataConnectionString"); food.SelectWhere("Name = ; "); }
public void TestCount() { int expected = 3; ACAD food = new CADType("GebatDataConnectionString"); int actual = food.Count(); Assert.AreEqual(expected, actual); }
public void SelectAllFailConn() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); food.SelectAll(); }
public void TestLastConnFail() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); food.Last(); }
public void SelectConnFail() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); List<object> ids = new List<object>(); ids.Add(2); food.Select(ids); }
public void Update() { ACAD food = new CADType("GebatDataConnectionString"); DataRow mod = food.GetVoidRow; mod["Id"] = 1; mod["Name"] = "Cajas"; food.Update(mod); }
public void SelectInvalidNumberId() { List<object> ids = new List<object>(); ids.Add("hola"); ids.Add(3); ACAD food = new CADType("GebatDataConnectionString"); food.Select(ids); }
public void UpdateNullRow() { ACAD food = new CADType("GebatDataConnectionString"); DataRow mod = null; food.Update(mod); }
public void SelectVoidList() { ACAD food = new CADType("GebatDataConnectionString"); food.Select(null); }
public void DeleteFailConn() { setFailConn(); ACAD food = new CADType("GebatDataConnectionString"); DataRow del = food.GetVoidRow; del["Id"] = 1; del["Name"] = "cajas"; food.Delete(del); }
public void SelectWhere() { ACAD food = new CADType("GebatDataConnectionString"); DataTable expected = tableFormat; DataRow row = expected.NewRow(); row["Id"] = 1; row["Name"] = "Kg"; expected.Rows.Add(row); DataTable actual = food.SelectWhere("Name = 'Kg'"); for (int i = 0; i < expected.Rows.Count; i++) { Assert.AreEqual(expected.Rows[i]["Id"], actual.Rows[i]["Id"]); Assert.AreEqual(expected.Rows[i]["Name"], actual.Rows[i]["Name"]); } }