public void TestDeleteRowsProcessedOutput() { Microsoft.SqlServer.Dts.Runtime.Package package = new Microsoft.SqlServer.Dts.Runtime.Package(); Executable exec = package.Executables.Add("STOCK:PipelineTask"); Microsoft.SqlServer.Dts.Runtime.TaskHost thMainPipe = exec as Microsoft.SqlServer.Dts.Runtime.TaskHost; MainPipe dataFlowTask = thMainPipe.InnerObject as MainPipe; ComponentEventHandler events = new ComponentEventHandler(); dataFlowTask.Events = DtsConvert.GetExtendedInterface(events as IDTSComponentEvents); IDTSComponentMetaData100 textFileSplitter = dataFlowTask.ComponentMetaDataCollection.New(); textFileSplitter.Name = "Row Splitter Test"; textFileSplitter.ComponentClassID = typeof(Martin.SQLServer.Dts.TextFileSplitter).AssemblyQualifiedName; CManagedComponentWrapper instance = textFileSplitter.Instantiate(); instance.ProvideComponentProperties(); Boolean exceptionThrown = false; try { instance.DeleteOutput(textFileSplitter.OutputCollection[3].ID); } catch (COMException ex) { Assert.AreEqual(MessageStrings.CannotDeleteRowsProcessedOutput, ex.Message, "Exception Message Wrong"); exceptionThrown = true; } Assert.IsTrue(exceptionThrown, "Exception Not Thrown"); }
public void TestValidateMissingOutput() { Microsoft.SqlServer.Dts.Runtime.Package package = new Microsoft.SqlServer.Dts.Runtime.Package(); Executable exec = package.Executables.Add("STOCK:PipelineTask"); Microsoft.SqlServer.Dts.Runtime.TaskHost thMainPipe = exec as Microsoft.SqlServer.Dts.Runtime.TaskHost; MainPipe dataFlowTask = thMainPipe.InnerObject as MainPipe; ComponentEventHandler events = new ComponentEventHandler(); dataFlowTask.Events = DtsConvert.GetExtendedInterface(events as IDTSComponentEvents); IDTSComponentMetaData100 speechToText = dataFlowTask.ComponentMetaDataCollection.New(); speechToText.ComponentClassID = typeof(Martin.SQLServer.Dts.SSISSpeechToText).AssemblyQualifiedName; CManagedComponentWrapper speechToTextInstance = speechToText.Instantiate(); speechToTextInstance.ProvideComponentProperties(); speechToTextInstance.DeleteOutput(speechToText.OutputCollection[0].ID); DTSValidationStatus actual = speechToTextInstance.Validate(); DTSValidationStatus expected = DTSValidationStatus.VS_ISCORRUPT; Assert.AreEqual(expected, actual); Assert.AreEqual("[Error] SSIS Speech To Text: The required output is missing from the collection.", events.errorMessages[0]); }