Ejemplo n.º 1
0
        //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;
        }
Ejemplo n.º 2
0
        public void SetDescriptionTest()
        {
            Issue issue = new Issue("test", "test2");

            Assert.IsTrue(issue.SetDescription("test"));
        }
Ejemplo n.º 3
0
        public void SetProjectNameTest()
        {
            Issue issue = new Issue("test", "test2");

            Assert.IsTrue(issue.SetProjectName("test2"));
        }
Ejemplo n.º 4
0
        public void IssueConstructorTest()
        {
            Issue issue = new Issue("test","test2");

            Assert.IsNotNull(issue);
        }