//Create issue public bool CreateIssue(Issue i) { bool flag; using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["connstring"].ConnectionString)) { using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "INSERT INTO [dbo].[Issues] (Description, ProjectName, RoadmapName) VALUES (@descrip,@Pname, @Rname)"; cmd.Parameters.AddWithValue("@descrip", i.GetDescription()); cmd.Parameters.AddWithValue("@Pname", mName); cmd.Parameters.AddWithValue("@Rname", mRoadmapName); cmd.Connection = conn; conn.Open(); flag = cmd.ExecuteNonQuery() != 0; conn.Close(); } } return flag; }
public void GetDescriptionTest() { Issue issue = new Issue("test", "test2"); Assert.IsTrue(issue.GetDescription()=="test"); }