示例#1
0
        public void AddColumnInformationTestReverse()
        {
            OutputColumn          target        = new OutputColumn();
            IDTSBufferManager100  bufferManager = new BufferManagerTestImpl();
            IDTSOutput100         output        = new OutputTestImpl();
            IDTSInput100          input         = new InputTestImpl();
            IDTSOutputColumn100   outputColumn;
            IDTSCustomProperty100 customProperty;
            int outputColumnIndex = 0;

            outputColumn         = output.OutputColumnCollection.New();
            customProperty       = outputColumn.CustomPropertyCollection.New();
            customProperty.Name  = Utility.InputColumnLineagePropName;
            customProperty.Value = "#1,#2,#3,#4,#5,#6";
            customProperty       = outputColumn.CustomPropertyCollection.New();
            customProperty.Name  = Utility.HashTypePropName;
            customProperty.Value = MultipleHash.HashTypeEnumerator.RipeMD160;

            target.AddColumnInformation(bufferManager, output, input, outputColumnIndex);
            Assert.AreEqual(6, target.Count, "The number of items in the list");
            Assert.AreEqual(1, target[0], "The first input");
            Assert.AreEqual(2, target[1], "The second input");
            Assert.AreEqual(3, target[2], "The third input");
            Assert.AreEqual(4, target[3], "The forth input");
            Assert.AreEqual(5, target[4], "The fifth input");
            Assert.AreEqual(6, target[5], "The sixth input");
            Assert.AreEqual(MultipleHash.HashTypeEnumerator.RipeMD160, target.HashType, "Hash");
            Assert.AreEqual(RIPEMD160.Create().ToString(), target.HashObject.ToString(), "Hash Object");
        }
示例#2
0
        public void AddColumnInformationTestErrors()
        {
            OutputColumn          target        = new OutputColumn();
            IDTSBufferManager100  bufferManager = new BufferManagerTestImpl();
            IDTSOutput100         output        = new OutputTestImpl();
            IDTSInput100          input         = new InputTestImpl();
            IDTSOutputColumn100   outputColumn;
            IDTSCustomProperty100 customProperty;
            int outputColumnIndex = 0;

            outputColumn         = output.OutputColumnCollection.New();
            customProperty       = outputColumn.CustomPropertyCollection.New();
            customProperty.Name  = Utility.HashTypePropName;
            customProperty.Value = MultipleHash.HashTypeEnumerator.MD5;
            customProperty       = outputColumn.CustomPropertyCollection.New();
            customProperty.Name  = Utility.InputColumnLineagePropName;
            customProperty.Value = "#1,#2,#3,#4,#5,#6";

            try
            {
                target.AddColumnInformation(null, output, input, outputColumnIndex);
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Value cannot be null.\r\nParameter name: bufferManager", ex.Message);
            }

            try
            {
                target.AddColumnInformation(bufferManager, null, input, outputColumnIndex);
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Value cannot be null.\r\nParameter name: output", ex.Message);
            }
            try
            {
                target.AddColumnInformation(bufferManager, output, null, outputColumnIndex);
            }
            catch (Exception ex)
            {
                Assert.AreEqual("Value cannot be null.\r\nParameter name: input", ex.Message);
            }
        }
示例#3
0
        public void AddColumnInformationTestHashTypes()
        {
            OutputColumn          target        = new OutputColumn();
            IDTSBufferManager100  bufferManager = new BufferManagerTestImpl();
            IDTSOutput100         output        = new OutputTestImpl();
            IDTSInput100          input         = new InputTestImpl();
            IDTSOutputColumn100   outputColumn;
            IDTSCustomProperty100 customProperty;
            int outputColumnIndex = 0;

            outputColumn         = output.OutputColumnCollection.New();
            customProperty       = outputColumn.CustomPropertyCollection.New();
            customProperty.Name  = Utility.InputColumnLineagePropName;
            customProperty.Value = "#1,#2,#3,#4,#5,#6";
            customProperty       = outputColumn.CustomPropertyCollection.New();
            customProperty.Name  = Utility.HashTypePropName;
            customProperty.Value = MultipleHash.HashTypeEnumerator.SHA1;

            target.AddColumnInformation(bufferManager, output, input, outputColumnIndex);
            Assert.AreEqual(MultipleHash.HashTypeEnumerator.SHA1, target.HashType, "Hash");
            Assert.AreEqual(SHA1.Create().ToString(), target.HashObject.ToString(), "Hash Object");
            customProperty.Value = MultipleHash.HashTypeEnumerator.SHA256;
            target.AddColumnInformation(bufferManager, output, input, outputColumnIndex);
            Assert.AreEqual(MultipleHash.HashTypeEnumerator.SHA256, target.HashType, "Hash");
            Assert.AreEqual(SHA256.Create().ToString(), target.HashObject.ToString(), "Hash Object");
            customProperty.Value = MultipleHash.HashTypeEnumerator.SHA384;
            target.AddColumnInformation(bufferManager, output, input, outputColumnIndex);
            Assert.AreEqual(MultipleHash.HashTypeEnumerator.SHA384, target.HashType, "Hash");
            Assert.AreEqual(SHA384.Create().ToString(), target.HashObject.ToString(), "Hash Object");
            customProperty.Value = MultipleHash.HashTypeEnumerator.SHA512;
            target.AddColumnInformation(bufferManager, output, input, outputColumnIndex);
            Assert.AreEqual(MultipleHash.HashTypeEnumerator.SHA512, target.HashType, "Hash");
            Assert.AreEqual(SHA512.Create().ToString(), target.HashObject.ToString(), "Hash Object");
            customProperty.Value = MultipleHash.HashTypeEnumerator.None;
            target.AddColumnInformation(bufferManager, output, input, outputColumnIndex);
            Assert.AreEqual(MultipleHash.HashTypeEnumerator.None, target.HashType, "Hash");
            Assert.AreEqual(null, target.HashObject, "Hash Object");
        }