Exemplo n.º 1
0
        public void PerformanceTest()
        {
            SidStringBiDirectionalTransform transform = new SidStringBiDirectionalTransform();
            SecurityIdentifier sid = WindowsIdentity.GetCurrent().User;

            byte[] sidbytes = new byte[sid.BinaryLength];
            sid.GetBinaryForm(sidbytes, 0);

            UnitTestControl.PerformanceTest(() =>
            {
                Assert.AreEqual(sid.Value,
                                transform.TransformValue(sidbytes).First());
            }, 170000);
        }
Exemplo n.º 2
0
        private void ExecuteTest(SidStringBiDirectionalTransform transform, byte[] sourceValue, string expectedValue)
        {
            string outValue = transform.TransformValue(sourceValue).FirstOrDefault() as string;

            Assert.AreEqual(expectedValue, outValue);
        }
Exemplo n.º 3
0
        private void ExecuteTest(SidStringBiDirectionalTransform transform, string sourceValue, byte[] expectedValue)
        {
            byte[] outValue = transform.TransformValue(sourceValue).FirstOrDefault() as byte[];

            CollectionAssert.AreEqual(expectedValue, outValue);
        }