Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-288.cs
1 using System;
2                              
3 namespace Test
4 {
5         public interface IBook
6         {
7                 string GetItem (int i);
8                 string this [int i] { get; }
9         }
10                                                                           
11                                                                           
12                              
13         public interface IMovie
14         {
15                 string GetItem (int i);
16                 string this [int i] { get; }
17         }
18                                                                           
19                                                                           
20                              
21         public class BookAboutMovie : IBook, IMovie
22         {
23                 private string title = "";
24                 public BookAboutMovie (string title)
25                 {
26                         this.title = title;
27                 }
28                                                                           
29                                                                           
30                              
31                 public string GetItem (int i)
32                 {
33                         return title;
34                 }
35                                                                           
36                                                                           
37                              
38                 public string this [int i]
39                 {
40                         get { return title; }
41                 }
42
43                 public static int Main ( string [] args)
44                 {
45                         BookAboutMovie jurassicPark = new BookAboutMovie("Jurassic Park");
46                         Console.WriteLine ("Book Title : " + jurassicPark.GetItem (2));
47                         Console.WriteLine ("Book Title : " + ((IBook)jurassicPark)[2] );
48                         return 0;
49                 }
50         }
51 }