Esempio n. 1
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            TransformKeyedCollection objectToSerialize = new TransformKeyedCollection();
            StringCaseTransform      transform1        = new StringCaseTransform();

            transform1.ID         = "tx0001";
            transform1.StringCase = StringCaseType.Title;

            GetDNComponentTransform transform2 = new GetDNComponentTransform();

            transform2.ID             = "tx0002";
            transform2.RdnFormat      = RdnFormat.ValueOnly;
            transform2.ComponentIndex = 1;

            objectToSerialize.Add(transform1);
            objectToSerialize.Add(transform2);
            UniqueIDCache.ClearIdCache();

            TransformKeyedCollection deserializedObject = (TransformKeyedCollection)UnitTestControl.XmlSerializeRoundTrip <TransformKeyedCollection>(objectToSerialize);

            Assert.AreEqual(objectToSerialize.Count, deserializedObject.Count);
            Assert.AreEqual(objectToSerialize[0].ID, transform1.ID);
            Assert.AreEqual(objectToSerialize[1].ID, transform2.ID);
        }
Esempio n. 2
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            DateConverterTransform transformToSeralize = new DateConverterTransform();

            transformToSeralize.ID                      = "test001";
            transformToSeralize.InputDateType           = DateType.FimServiceString;
            transformToSeralize.InputFormat             = "abc";
            transformToSeralize.InputTimeZone           = TimeZoneInfo.Utc;
            transformToSeralize.CalculationOperator     = DateOperator.Add;
            transformToSeralize.CalculationTimeSpanType = TimeSpanType.Hours;
            transformToSeralize.CalculationValue        = 6;
            transformToSeralize.OutputDateType          = DateType.String;
            transformToSeralize.OutputFormat            = "def";
            transformToSeralize.OutputTimeZone          = TimeZoneInfo.Local;
            UniqueIDCache.ClearIdCache();

            DateConverterTransform deserializedTransform = (DateConverterTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.InputDateType, deserializedTransform.InputDateType);
            Assert.AreEqual(transformToSeralize.InputFormat, deserializedTransform.InputFormat);
            Assert.AreEqual(transformToSeralize.InputTimeZone, deserializedTransform.InputTimeZone);
            Assert.AreEqual(transformToSeralize.CalculationOperator, deserializedTransform.CalculationOperator);
            Assert.AreEqual(transformToSeralize.CalculationTimeSpanType, deserializedTransform.CalculationTimeSpanType);
            Assert.AreEqual(transformToSeralize.CalculationValue, deserializedTransform.CalculationValue);
            Assert.AreEqual(transformToSeralize.OutputFormat, deserializedTransform.OutputFormat);
            Assert.AreEqual(transformToSeralize.OutputDateType, deserializedTransform.OutputDateType);
            Assert.AreEqual(transformToSeralize.OutputTimeZone, deserializedTransform.OutputTimeZone);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            SimpleLookupTransform transformToSeralize = new SimpleLookupTransform();

            transformToSeralize.DefaultValue = "A";
            transformToSeralize.LookupItems.Add(new LookupItem()
            {
                CurrentValue = "test1", NewValue = "test2"
            });
            transformToSeralize.LookupItems.Add(new LookupItem()
            {
                CurrentValue = "test3", NewValue = "test4"
            });
            transformToSeralize.OnMissingMatch        = OnMissingMatch.UseNull;
            transformToSeralize.UserDefinedReturnType = ExtendedAttributeType.Binary;

            transformToSeralize.ID = "test001";
            UniqueIDCache.ClearIdCache();

            SimpleLookupTransform deserializedTransform = (SimpleLookupTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.DefaultValue, deserializedTransform.DefaultValue);
            Assert.AreEqual(transformToSeralize.OnMissingMatch, deserializedTransform.OnMissingMatch);
            Assert.AreEqual(transformToSeralize.UserDefinedReturnType, deserializedTransform.UserDefinedReturnType);
            CollectionAssert.AreEqual(transformToSeralize.LookupItems, deserializedTransform.LookupItems, new LookupItemComparer());
        }
Esempio n. 4
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            SidToDomainTransform transformToSeralize = new SidToDomainTransform();

            transformToSeralize.ID     = "test001";
            transformToSeralize.Format = DomainFormat.DomainName;
            UniqueIDCache.ClearIdCache();

            SidToDomainTransform deserializedTransform = (SidToDomainTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Format, deserializedTransform.Format);
        }
Esempio n. 5
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            StringSplitTransform transformToSeralize = new StringSplitTransform();

            transformToSeralize.ID         = "test001";
            transformToSeralize.SplitRegex = ",";
            UniqueIDCache.ClearIdCache();

            StringSplitTransform deserializedTransform = (StringSplitTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.SplitRegex, deserializedTransform.SplitRegex);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            FormatStringTransform transformToSeralize = new FormatStringTransform();

            transformToSeralize.ID     = "test001";
            transformToSeralize.Format = "{0}\n{1}";
            UniqueIDCache.ClearIdCache();

            FormatStringTransform deserializedTransform = (FormatStringTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Format, deserializedTransform.Format);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            ValueMergeTransform transformToSeralize = new ValueMergeTransform();

            transformToSeralize.ID = "test001";
            transformToSeralize.UserDefinedReturnType = ExtendedAttributeType.Integer;
            UniqueIDCache.ClearIdCache();

            ValueMergeTransform deserializedTransform = (ValueMergeTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.UserDefinedReturnType, deserializedTransform.UserDefinedReturnType);
        }
Esempio n. 8
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            TrimStringTransform transformToSeralize = new TrimStringTransform();

            transformToSeralize.ID       = "test001";
            transformToSeralize.TrimType = TrimType.Both;
            UniqueIDCache.ClearIdCache();

            TrimStringTransform deserializedTransform = (TrimStringTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.TrimType, deserializedTransform.TrimType);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            StringCaseTransform transformToSeralize = new StringCaseTransform();

            transformToSeralize.ID         = "test001";
            transformToSeralize.StringCase = StringCaseType.Title;
            UniqueIDCache.ClearIdCache();

            StringCaseTransform deserializedTransform = (StringCaseTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.StringCase, deserializedTransform.StringCase);
        }
Esempio n. 10
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            ConcatStringTransform transformToSeralize = new ConcatStringTransform();

            transformToSeralize.ID        = "test001";
            transformToSeralize.Delimiter = ",";
            UniqueIDCache.ClearIdCache();

            ConcatStringTransform deserializedTransform = (ConcatStringTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Delimiter, deserializedTransform.Delimiter);
        }
Esempio n. 11
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            BitmaskTransform transformToSeralize = new BitmaskTransform();

            transformToSeralize.ID        = "test001";
            transformToSeralize.Flag      = 2;
            transformToSeralize.Operation = BitwiseOperation.And;
            UniqueIDCache.ClearIdCache();

            BitmaskTransform deserializedTransform = (BitmaskTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Flag, deserializedTransform.Flag);
            Assert.AreEqual(transformToSeralize.Operation, deserializedTransform.Operation);
        }
Esempio n. 12
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            RegexReplaceTransform transformToSeralize = new RegexReplaceTransform();

            transformToSeralize.ID             = "test001";
            transformToSeralize.FindPattern    = "zz";
            transformToSeralize.ReplacePattern = "aa";
            UniqueIDCache.ClearIdCache();

            RegexReplaceTransform deserializedTransform = (RegexReplaceTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.FindPattern, deserializedTransform.FindPattern);
            Assert.AreEqual(transformToSeralize.ReplacePattern, deserializedTransform.ReplacePattern);
        }
Esempio n. 13
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();

            GetDNComponentTransform transformToSeralize = new GetDNComponentTransform();

            transformToSeralize.ID             = "test001";
            transformToSeralize.RdnFormat      = RdnFormat.Rdn;
            transformToSeralize.ComponentIndex = 5;
            transformToSeralize.Direction      = Direction.Right;

            UniqueIDCache.ClearIdCache();

            GetDNComponentTransform deserializedTransform = (GetDNComponentTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.RdnFormat, deserializedTransform.RdnFormat);
            Assert.AreEqual(transformToSeralize.ComponentIndex, deserializedTransform.ComponentIndex);
            Assert.AreEqual(transformToSeralize.Direction, deserializedTransform.Direction);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            XPathQueryTransform transformToSeralize = new XPathQueryTransform();

            transformToSeralize.DefaultValue          = "A";
            transformToSeralize.XPathQuery            = "Query";
            transformToSeralize.OnMissingMatch        = OnMissingMatch.UseNull;
            transformToSeralize.ID                    = "test001";
            transformToSeralize.UserDefinedReturnType = ExtendedAttributeType.Boolean;
            UniqueIDCache.ClearIdCache();

            XPathQueryTransform deserializedTransform = (XPathQueryTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.DefaultValue, deserializedTransform.DefaultValue);
            Assert.AreEqual(transformToSeralize.XPathQuery, deserializedTransform.XPathQuery);
            Assert.AreEqual(transformToSeralize.OnMissingMatch, deserializedTransform.OnMissingMatch);
            Assert.AreEqual(transformToSeralize.UserDefinedReturnType, deserializedTransform.UserDefinedReturnType);
        }
Esempio n. 15
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            SubstringTransform transformToSeralize = new SubstringTransform();

            transformToSeralize.ID           = "test001";
            transformToSeralize.Length       = 5;
            transformToSeralize.PadCharacter = "d";
            transformToSeralize.PaddingType  = PadType.LastCharacter;
            transformToSeralize.StartIndex   = 99;
            transformToSeralize.Direction    = Direction.Right;
            UniqueIDCache.ClearIdCache();

            SubstringTransform deserializedTransform = (SubstringTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Length, deserializedTransform.Length);
            Assert.AreEqual(transformToSeralize.PadCharacter, deserializedTransform.PadCharacter);
            Assert.AreEqual(transformToSeralize.PaddingType, deserializedTransform.PaddingType);
            Assert.AreEqual(transformToSeralize.StartIndex, deserializedTransform.StartIndex);
            Assert.AreEqual(transformToSeralize.Direction, deserializedTransform.Direction);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            StringReplaceTransform transformToSeralize = new StringReplaceTransform();

            transformToSeralize.LookupItems.Add(new LookupItem()
            {
                CurrentValue = "test1", NewValue = "test2"
            });
            transformToSeralize.LookupItems.Add(new LookupItem()
            {
                CurrentValue = "test3", NewValue = "test4"
            });
            transformToSeralize.IgnoreCase = true;
            transformToSeralize.ID         = "test001";
            UniqueIDCache.ClearIdCache();

            StringReplaceTransform deserializedTransform = (StringReplaceTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.IgnoreCase, deserializedTransform.IgnoreCase);
            CollectionAssert.AreEqual(transformToSeralize.LookupItems, deserializedTransform.LookupItems, new LookupItemComparer());
        }
Esempio n. 17
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            SidStringBiDirectionalTransform transformToSeralize = new SidStringBiDirectionalTransform();

            transformToSeralize.ID = "test001";
            UniqueIDCache.ClearIdCache();

            SidStringBiDirectionalTransform deserializedTransform = (SidStringBiDirectionalTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            DelimitedTextFileLookupTransform transformToSeralize = new DelimitedTextFileLookupTransform();

            transformToSeralize.DefaultValue          = "A";
            transformToSeralize.FileName              = "B";
            transformToSeralize.FindColumn            = 1;
            transformToSeralize.HasHeaderRow          = true;
            transformToSeralize.OnMissingMatch        = OnMissingMatch.UseNull;
            transformToSeralize.ReplaceColumn         = 5;
            transformToSeralize.ID                    = "test001";
            transformToSeralize.CustomDelimiterRegex  = "1234";
            transformToSeralize.DelimiterType         = DelimiterType.Custom;
            transformToSeralize.CustomEscapeSequence  = "\\";
            transformToSeralize.UserDefinedReturnType = ExtendedAttributeType.Integer;
            UniqueIDCache.ClearIdCache();

            DelimitedTextFileLookupTransform deserializedTransform = (DelimitedTextFileLookupTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.DefaultValue, deserializedTransform.DefaultValue);
            Assert.AreEqual(transformToSeralize.FileName, deserializedTransform.FileName);
            Assert.AreEqual(transformToSeralize.FindColumn, deserializedTransform.FindColumn);
            Assert.AreEqual(transformToSeralize.HasHeaderRow, deserializedTransform.HasHeaderRow);
            Assert.AreEqual(transformToSeralize.OnMissingMatch, deserializedTransform.OnMissingMatch);
            Assert.AreEqual(transformToSeralize.ReplaceColumn, deserializedTransform.ReplaceColumn);
            Assert.AreEqual(transformToSeralize.CustomDelimiterRegex, deserializedTransform.CustomDelimiterRegex);
            Assert.AreEqual(transformToSeralize.DelimiterType, deserializedTransform.DelimiterType);
            Assert.AreEqual(transformToSeralize.CustomEscapeSequence, deserializedTransform.CustomEscapeSequence);
            Assert.AreEqual(transformToSeralize.UserDefinedReturnType, deserializedTransform.UserDefinedReturnType);
        }
Esempio n. 19
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            BooleanOperationTransform transformToSeralize = new BooleanOperationTransform();

            transformToSeralize.ID       = "test001";
            transformToSeralize.Operator = BitwiseOperation.And;
            UniqueIDCache.ClearIdCache();

            BooleanOperationTransform deserializedTransform = (BooleanOperationTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Operator, deserializedTransform.Operator);
        }
Esempio n. 20
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            MultivalueToSingleValueTransform transformToSeralize = new MultivalueToSingleValueTransform();

            transformToSeralize.ID = "test001";
            transformToSeralize.SelectorOperator = ValueOperator.Equals;
            transformToSeralize.SelectorValue    = "test";
            transformToSeralize.CompareAs        = ExtendedAttributeType.DateTime;
            UniqueIDCache.ClearIdCache();

            MultivalueToSingleValueTransform deserializedTransform = (MultivalueToSingleValueTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.SelectorOperator, deserializedTransform.SelectorOperator);
            Assert.AreEqual(transformToSeralize.SelectorValue, deserializedTransform.SelectorValue);
            Assert.AreEqual(transformToSeralize.CompareAs, deserializedTransform.CompareAs);
        }
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            ConditionalStringFlowTransform transformToSeralize = new ConditionalStringFlowTransform();

            transformToSeralize.ID             = "test001";
            transformToSeralize.ComparisonType = StringComparison.InvariantCulture;
            UniqueIDCache.ClearIdCache();

            ConditionalStringFlowTransform deserializedTransform = (ConditionalStringFlowTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.ComparisonType, deserializedTransform.ComparisonType);
        }
Esempio n. 22
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            MVBooleanToBitmaskTransform transformToSeralize = new MVBooleanToBitmaskTransform();

            transformToSeralize.ID = "test001";
            transformToSeralize.Flags.Add(new FlagValue()
            {
                Name = "AccountDisabled", Value = 2
            });
            transformToSeralize.Flags.Add(new FlagValue()
            {
                Name = "DontExpirePassword", Value = 65535
            });
            transformToSeralize.DefaultValue = 512;
            UniqueIDCache.ClearIdCache();

            MVBooleanToBitmaskTransform deserializedTransform = (MVBooleanToBitmaskTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
            Assert.AreEqual(transformToSeralize.Flags[0].Name, deserializedTransform.Flags[0].Name);
            Assert.AreEqual(transformToSeralize.Flags[1].Name, deserializedTransform.Flags[1].Name);
            Assert.AreEqual(transformToSeralize.Flags[0].Value, deserializedTransform.Flags[0].Value);
            Assert.AreEqual(transformToSeralize.Flags[1].Value, deserializedTransform.Flags[1].Value);
            Assert.AreEqual(transformToSeralize.DefaultValue, deserializedTransform.DefaultValue);
        }
Esempio n. 23
0
        public void TestSerialization()
        {
            UniqueIDCache.ClearIdCache();
            GroupStringsToADGroupTypeTransform transformToSeralize = new GroupStringsToADGroupTypeTransform();

            transformToSeralize.ID = "test001";
            UniqueIDCache.ClearIdCache();

            GroupStringsToADGroupTypeTransform deserializedTransform = (GroupStringsToADGroupTypeTransform)UnitTestControl.XmlSerializeRoundTrip <Transform>(transformToSeralize);

            Assert.AreEqual(transformToSeralize.ID, deserializedTransform.ID);
        }