OdbcMetaDataCollectionNamesTest.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // OdbcMetaDataCollectionNamesTest.cs - NUnit Test Cases for testing the
  2. // OdbcMetaDataCollectionNames Test.
  3. //
  4. // Authors:
  5. // Amit Biswas ([email protected])
  6. //
  7. // Copyright (c) 2004 Novell Inc., and the individuals listed on the
  8. // ChangeLog entries.
  9. //
  10. //
  11. // Permission is hereby granted, free of charge, to any person
  12. // obtaining a copy of this software and associated documentation
  13. // files (the "Software"), to deal in the Software without
  14. // restriction, including without limitation the rights to use, copy,
  15. // modify, merge, publish, distribute, sublicense, and/or sell copies
  16. // of the Software, and to permit persons to whom the Software is
  17. // furnished to do so, subject to the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  26. // BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  27. // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  28. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  29. // SOFTWARE.
  30. using System;
  31. using System.Data;
  32. using System.Data.Common;
  33. using System.Data.Odbc;
  34. using Mono.Data;
  35. using NUnit.Framework;
  36. namespace MonoTests.System.Data
  37. {
  38. [TestFixture]
  39. [Category("odbc")]
  40. public class OdbcMetaDataCollectionNamesTest
  41. {
  42. [Test]
  43. public void EqualsTest()
  44. {
  45. object TestObj1;
  46. object TestObj2;
  47. TestObj1 = "Bangalore";
  48. TestObj2 = "Bangalore";
  49. Assert.AreEqual(true, OdbcMetaDataCollectionNames.Equals(TestObj1, TestObj2), "#1 Objects with same value");
  50. TestObj1 = "Bangalore";
  51. TestObj2 = "Mumbai";
  52. Assert.AreEqual(false, OdbcMetaDataCollectionNames.Equals(TestObj1, TestObj2), "#2 Objects with different value");
  53. TestObj1 = null;
  54. TestObj2 = "Bangalore";
  55. Assert.AreEqual(false, OdbcMetaDataCollectionNames.Equals(TestObj1, TestObj2), "#3 null to not-null");
  56. TestObj1 = "Bangalore";
  57. TestObj2 = null;
  58. Assert.AreEqual(false, OdbcMetaDataCollectionNames.Equals(TestObj1, TestObj2), "#4 not-null to null");
  59. TestObj1 = null;
  60. TestObj2 = null;
  61. Assert.AreEqual(true, OdbcMetaDataCollectionNames.Equals(TestObj1, TestObj2), "#5 null to null");
  62. }
  63. }
  64. }