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); }
private void ExecuteTest(SidStringBiDirectionalTransform transform, byte[] sourceValue, string expectedValue) { string outValue = transform.TransformValue(sourceValue).FirstOrDefault() as string; Assert.AreEqual(expectedValue, outValue); }
private void ExecuteTest(SidStringBiDirectionalTransform transform, string sourceValue, byte[] expectedValue) { byte[] outValue = transform.TransformValue(sourceValue).FirstOrDefault() as byte[]; CollectionAssert.AreEqual(expectedValue, outValue); }