public void DataService_AddTermToContent_Adds_Record_If_Valid()
        {
            //Arrange
            int rowCount = DataUtil.GetRecordCount(DataTestHelper.ConnectionString,
                                                   ContentDataTestHelper.ContentTagsTableName);
            DataUtil.AddDatabaseObject(virtualScriptFilePath, addTermToContent);

            ContentItem content = ContentTestHelper.CreateValidContentItem();
            Term term = ContentTestHelper.CreateValidSimpleTerm(Constants.VOCABULARY_ValidVocabularyId);

            DataService ds = new DataService();

            //Act
            ds.AddTermToContent(term, content);

            //Assert
            DatabaseAssert.RecordCountIsEqual(DataTestHelper.ConnectionString,
                                              ContentDataTestHelper.ContentTagsTableName, rowCount + 1);
        }
        public void DataService_AddTermToContent_Throws_If_Duplicate()
        {
            //Arrange
            int rowCount = DataUtil.GetRecordCount(DataTestHelper.ConnectionString,
                                                   ContentDataTestHelper.ContentTagsTableName);
            DataUtil.AddDatabaseObject(virtualScriptFilePath, addTermToContent);

            ContentItem content = ContentTestHelper.CreateValidContentItem();
            content.ContentItemId = Constants.TAG_DuplicateContentItemId;
            Term term = ContentTestHelper.CreateValidSimpleTerm(Constants.VOCABULARY_ValidVocabularyId);
            term.TermId = Constants.TAG_DuplicateTermId;

            DataService ds = new DataService();

            //Act/Assert
            Assert.Throws<SqlException>(() => ds.AddTermToContent(term, content));
        }