Microsoft.VisualStudio.TestTools.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. 
  2. using System;
  3. namespace Microsoft.VisualStudio.TestTools.UnitTesting
  4. {
  5. [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
  6. public sealed class TestClassAttribute : NUnit.Framework.TestFixtureAttribute
  7. {
  8. }
  9. [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
  10. public sealed class TestMethodAttribute : NUnit.Framework.TestAttribute
  11. {
  12. }
  13. [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
  14. public sealed class TestInitializeAttribute : NUnit.Framework.SetUpAttribute
  15. {
  16. }
  17. [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
  18. public sealed class IgnoreAttribute : NUnit.Framework.IgnoreAttribute
  19. {
  20. }
  21. [AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
  22. public sealed class ExpectedExceptionAttribute : NUnit.Framework.ExpectedExceptionAttribute
  23. {
  24. public ExpectedExceptionAttribute(Type type) : base(type)
  25. { }
  26. }
  27. public class Assert : NUnit.Framework.Assert
  28. {
  29. [Obsolete("Do not use AreEqual on Byte[], use TestUtil.AssertBytesEqual(,)")]
  30. public static void AreEqual(byte[] b1, byte[] b2)
  31. {
  32. NUnit.Framework.Assert.AreEqual(b1, b2);
  33. }
  34. [Obsolete("No not use assert with miss-matched types.")]
  35. public static new void AreEqual(object b1, object b2)
  36. {
  37. NUnit.Framework.Assert.AreEqual(b1, b2);
  38. }
  39. //Allowed if the types match
  40. public static void AreEqual<T>(T b1, T b2)
  41. {
  42. NUnit.Framework.Assert.AreEqual(b1, b2);
  43. }
  44. }
  45. }