summaryrefslogtreecommitdiff
path: root/proxies/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'proxies/Program.cs')
-rw-r--r--proxies/Program.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/proxies/Program.cs b/proxies/Program.cs
new file mode 100644
index 0000000..511f45a
--- /dev/null
+++ b/proxies/Program.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace proxies
+{
+ internal class Program
+ {
+ private static void Main(string[] args)
+ {
+ var marshal_mathers = new Person("marshall mathers");
+ var some_celebrity = ProxyFactory.Create<IPerson>(marshal_mathers, new MyNameIsSlimShadyInterceptor());
+
+ try
+ {
+ var name = some_celebrity.what_is_your_name();
+ name.should_be_equal_to("slim shady");
+ }
+ catch (Exception e)
+ {
+ Console.Out.WriteLine(e);
+ }
+ Console.Out.WriteLine("will the real slim shady please stand up...");
+ Console.In.ReadLine();
+ }
+ }
+} \ No newline at end of file