DebugTest.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // MonoTests.System.Diagnostics.DebugTest.cs
  3. //
  4. // Author:
  5. // John R. Hicks ([email protected])
  6. //
  7. // (C) 2002
  8. using System;
  9. using System.Diagnostics;
  10. using NUnit.Framework;
  11. namespace MonoTests.System.Diagnostics
  12. {
  13. [TestFixture]
  14. public class DebugTest2
  15. {
  16. DefaultTraceListener listener = new DefaultTraceListener ();
  17. [SetUp]
  18. protected void SetUp()
  19. {
  20. Debug.Listeners.Add(listener);
  21. }
  22. [TearDown]
  23. protected void TearDown()
  24. {
  25. Debug.Listeners.Remove (listener);
  26. }
  27. [Test]
  28. public void TestAssert()
  29. {
  30. Debug.Assert(false, "Testing Assertions");
  31. }
  32. [Test]
  33. public void TestFail ()
  34. {
  35. Debug.Fail("Testing Fail method");
  36. }
  37. [Test]
  38. public void TestWrite()
  39. {
  40. Debug.Write("Testing Write", "Testing the output of the Write method");
  41. }
  42. [Test]
  43. public void TestWriteIf()
  44. {
  45. Debug.WriteIf(true, "Testing WriteIf");
  46. Debug.WriteIf(false, "Testing WriteIf", "Passed false");
  47. }
  48. [Test]
  49. public void TestWriteLine()
  50. {
  51. Debug.WriteLine("Testing WriteLine method");
  52. }
  53. [Test]
  54. public void TestWriteLineIf()
  55. {
  56. Debug.WriteLineIf(true, "Testing WriteLineIf");
  57. Debug.WriteLineIf(false, "Testing WriteLineIf", "Passed false");
  58. }
  59. }
  60. }