public void TestUpdateIssueType()
        {
            using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.SQLConnectionString))
            {
                connection.Open();

                DeleteTables(connection);

                int    ID   = -1;
                string name = "XXXZZZ";

                Create(connection, ID, name);

                string updatedName = "XXXZZZUUU";

                IssueTypeService issueTypeService = new IssueTypeService();
                IssueTypeItem    issueTypeItem    = new IssueTypeItem
                {
                    IssueTypeID   = -1,
                    IssueTypeName = updatedName
                };

                issueTypeService.UpdateIssueType(issueTypeItem);

                int count = GetCount(connection, updatedName);

                Assert.AreEqual(count, 1);
            }
        }
        public void TestDeleteIssueType()
        {
            using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.SQLConnectionString))
            {
                connection.Open();

                DeleteTables(connection);

                int    ID   = -1;
                string name = "Test";
                Create(connection, ID, name);

                IssueTypeService issueTypeService = new IssueTypeService();
                IssueTypeItem    issueTypeItem    = new IssueTypeItem
                {
                    IssueTypeID = ID
                };

                issueTypeService.DeleteIssueType(issueTypeItem);

                int count = GetCount(connection);

                Assert.AreEqual(count, 0);
            }
        }
        public void TestGetIssueTypes()
        {
            using (SqlConnection connection = new SqlConnection(Properties.Settings.Default.SQLConnectionString))
            {
                connection.Open();

                DeleteTables(connection);

                int    ID1   = -1;
                string name1 = "Test";
                Create(connection, ID1, name1);

                int    ID2   = -2;
                string name2 = "Test";
                Create(connection, ID2, name2);

                IssueTypeService      issueTypeService  = new IssueTypeService();
                IList <IssueTypeItem> issueTypeItemList = issueTypeService.GetIssueTypes();

                Assert.AreEqual(issueTypeItemList.Count, 2);
            }
        }
 public IssueTypeController()
 {
     service = new IssueTypeService();
 }