/trunk/Examples/test-suite/csharp/default_constructor_runme.cs

# · C# · 24 lines · 20 code · 2 blank · 2 comment · 0 complexity · 1705081c50191e2f9cb632d77ae4914d MD5 · raw file

  1. using System;
  2. using default_constructorNamespace;
  3. public class runme
  4. {
  5. static void Main()
  6. {
  7. // calling protected destructor test
  8. try {
  9. using (G g = new G()) {
  10. }
  11. throw new Exception("Protected destructor exception should have been thrown");
  12. } catch (MethodAccessException) {
  13. }
  14. // calling private destructor test
  15. try {
  16. using (FFF f = new FFF()) {
  17. }
  18. throw new Exception("Private destructor exception should have been thrown");
  19. } catch (MethodAccessException) {
  20. }
  21. }
  22. }