Exemple #1
0
        private void ExecuteTestBinary(MultivalueToSingleValueTransform transform, IList <object> sourceValues, byte[] expectedValue)
        {
            IEnumerable <object> outValues = transform.TransformValue(sourceValues);

            if (outValues.Count() > 1)
            {
                Assert.Fail("Multiple objects were returned");
            }

            CollectionAssert.AreEqual(expectedValue, (byte[])outValues.First());
        }
Exemple #2
0
        private void ExecuteTestInteger(MultivalueToSingleValueTransform transform, IList <object> sourceValues, long expectedValue)
        {
            IEnumerable <object> outValues = transform.TransformValue(sourceValues);

            if (outValues.Count() > 1)
            {
                Assert.Fail("Multiple objects were returned");
            }

            Assert.AreEqual(expectedValue, (long)outValues.First());
        }
Exemple #3
0
        public void PerformanceTest()
        {
            MultivalueToSingleValueTransform transform = new MultivalueToSingleValueTransform();

            transform.SelectorOperator = ValueOperator.Equals;
            transform.SelectorValue    = "Ryan";
            transform.CompareAs        = ExtendedAttributeType.String;

            UnitTestControl.PerformanceTest(() =>
            {
                Assert.AreEqual("Ryan", transform.TransformValue(new List <object>()
                {
                    "Bob", "Ryan"
                }).First());
            }, 200000);
        }