summaryrefslogtreecommitdiff
path: root/spec/unit/infrastructure/proxies/ProxyFactorySpecs.cs
blob: 4422d1ef0486198b8fc5050a45f3c573ac86f00b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//using gorilla.infrastructure.proxies;
//using Machine.Specifications;

//namespace specs.unit.infrastructure.proxies
//{
    //public class ProxyFactorySpecs
    //{
        //[Subject(typeof (ProxyFactory))]
        //public class when_proxying_a_class_with_interceptors_applied
        //{
            //Establish c = () =>
            //{
                //interceptors = new MyNameIsSlimShadyInterceptor();
                //marshal_mathers = new Person("marshall mathers");
            //};

            //Because b =
                //() =>
                //{
                    //some_celebrity = ProxyFactory.create<IPerson>(marshal_mathers, interceptors);
                //};

            //It should_all_each_interceptor_to_intercept_the_invocation =
                //() => some_celebrity.what_is_your_name().should_be_equal_to("slim shady");

            //static Person marshal_mathers;
            //static IPerson some_celebrity;
            //static Interceptor interceptors;
        //}

        //public interface IPerson
        //{
            //string what_is_your_name();
        //}

        //public class Person : IPerson
        //{
            //readonly string my_name;

            //public Person(string my_name)
            //{
                //this.my_name = my_name;
            //}

            //public string what_is_your_name()
            //{
                //return my_name;
            //}
        //}

        //public class MyNameIsSlimShadyInterceptor : Interceptor
        //{
            //public void intercept(Invocation invocation)
            //{
                //invocation.proceed();
                //invocation.return_value = "slim shady";
            //}
        //}
    //}
//}