public void DeleteManufacturerTest() { DBManager_Accessor target = new DBManager_Accessor(); // TODO: Initialize to an appropriate value string manufacturerName = string.Empty; // TODO: Initialize to an appropriate value target.DeleteManufacturer(manufacturerName); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void AddManufacturerTest() { DBManager_Accessor target = new DBManager_Accessor(); // TODO: Initialize to an appropriate value string manufacturerName = "just for test"; // TODO: Initialize to an appropriate value string address = "just for test"; // TODO: Initialize to an appropriate value string country = "just for test"; // TODO: Initialize to an appropriate value string contact = "88888888"; // TODO: Initialize to an appropriate value target.AddManufacturer(manufacturerName, address, country, contact); DataTable dtExpected = new DataTable(); DataTable dtResult = target.FetchManufacturer(); try { dtExpected.Columns.Add("Manufacturer", typeof(string)); dtExpected.Columns.Add("Address", typeof(string)); dtExpected.Columns.Add("Country", typeof(string)); dtExpected.Columns.Add("Contact", typeof(string)); dtExpected.Rows.Add(manufacturerName, address, country, contact); //Comparison for (int i = 0; i < dtResult.Rows.Count; i++) { if (dtResult.Rows[i]["ManufacturerName"].ToString().Equals(dtExpected.Rows[0]["Manufacturer"].ToString())) { Assert.AreEqual(dtResult.Rows[i]["ManufacturerName"].ToString(), dtExpected.Rows[0]["ManufacturerName"].ToString()); Assert.AreEqual(dtResult.Rows[i]["Address"].ToString(), dtExpected.Rows[0]["Address"].ToString()); Assert.AreEqual(dtResult.Rows[i]["Country"].ToString(), dtExpected.Rows[0]["Country"].ToString()); Assert.AreEqual(dtResult.Rows[i]["Contact"].ToString(), dtExpected.Rows[0]["Contact"].ToString()); } } } catch { target.DeleteManufacturer(manufacturerName); } }