OracleParameter_ctor_SOIPBBBSDO.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //
  2. // Copyright (c) 2006 Mainsoft Co.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining
  5. // a copy of this software and associated documentation files (the
  6. // "Software"), to deal in the Software without restriction, including
  7. // without limitation the rights to use, copy, modify, merge, publish,
  8. // distribute, sublicense, and/or sell copies of the Software, and to
  9. // permit persons to whom the Software is furnished to do so, subject to
  10. // the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be
  13. // included in all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  16. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  19. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  20. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  21. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22. //
  23. using System;
  24. using System.Data;
  25. using System.Data.OracleClient;
  26. using MonoTests.System.Data.Utils;
  27. using NUnit.Framework;
  28. namespace MonoTests.System.Data.OracleClient
  29. {
  30. [TestFixture]
  31. public class OracleParameter_ctor_SOIPBBBSDO : GHTBase
  32. {
  33. public static void Main()
  34. {
  35. OracleParameter_ctor_SOIPBBBSDO tc = new OracleParameter_ctor_SOIPBBBSDO();
  36. Exception exp = null;
  37. try
  38. {
  39. tc.BeginTest("OracleParameter_ctor_SOIPBBBSDO");
  40. tc.run();
  41. }
  42. catch(Exception ex){exp = ex;}
  43. finally {tc.EndTest(exp);}
  44. }
  45. [Test]
  46. public void run()
  47. {
  48. Exception exp = null;
  49. OracleParameter param = new OracleParameter("myParam", //param name
  50. OracleType.Double, //type
  51. 5, //size
  52. ParameterDirection.Input, //direction
  53. true, //nillbale
  54. 1, //precision
  55. 1, //scale
  56. "Column1", //source column
  57. DataRowVersion.Current, //datarow version
  58. 590.456); //value
  59. try
  60. {
  61. BeginCase("ParameterName");
  62. Compare(param.ParameterName , "myParam");
  63. }
  64. catch(Exception ex){exp = ex;}
  65. finally{EndCase(exp); exp = null;}
  66. try
  67. {
  68. BeginCase("OracleType");
  69. Compare(param.OracleType ,OracleType.Double );
  70. }
  71. catch(Exception ex){exp = ex;}
  72. finally{EndCase(exp); exp = null;}
  73. try
  74. {
  75. BeginCase("Size");
  76. Compare(param.Size , 5);
  77. }
  78. catch(Exception ex){exp = ex;}
  79. finally{EndCase(exp); exp = null;}
  80. try
  81. {
  82. BeginCase("ParameterDirection");
  83. Compare(param.Direction , ParameterDirection.Input );
  84. }
  85. catch(Exception ex){exp = ex;}
  86. finally{EndCase(exp); exp = null;}
  87. try
  88. {
  89. BeginCase("IsNullable");
  90. Compare(param.IsNullable , true);
  91. }
  92. catch(Exception ex){exp = ex;}
  93. finally{EndCase(exp); exp = null;}
  94. try
  95. {
  96. BeginCase("Precision");
  97. Compare(param.Precision , (byte)1);
  98. }
  99. catch(Exception ex){exp = ex;}
  100. finally{EndCase(exp); exp = null;}
  101. try
  102. {
  103. BeginCase("Scale");
  104. Compare(param.Scale , (byte)1);
  105. }
  106. catch(Exception ex){exp = ex;}
  107. finally{EndCase(exp); exp = null;}
  108. try
  109. {
  110. BeginCase("SourceColumn");
  111. Compare(param.SourceColumn ,"Column1");
  112. }
  113. catch(Exception ex){exp = ex;}
  114. finally{EndCase(exp); exp = null;}
  115. try
  116. {
  117. BeginCase("SourceVersion");
  118. Compare(param.SourceVersion ,DataRowVersion.Current );
  119. }
  120. catch(Exception ex){exp = ex;}
  121. finally{EndCase(exp); exp = null;}
  122. try
  123. {
  124. BeginCase("Value");
  125. Compare(param.Value ,590.456);
  126. }
  127. catch(Exception ex){exp = ex;}
  128. finally{EndCase(exp); exp = null;}
  129. }
  130. //public TestClass():base(true){}
  131. //Activate this constructor to log Failures to a log file
  132. //public TestClass(System.IO.TextWriter tw):base(tw, false){}
  133. //Activate this constructor to log All to a log file
  134. //public TestClass(System.IO.TextWriter tw):base(tw, true){}
  135. //BY DEFAULT LOGGING IS DONE TO THE STANDARD OUTPUT ONLY FOR FAILURES
  136. }
  137. }