public void ReturnsValueType()
            {
                RecordingHandler handler = new RecordingHandler();
                MethodBase       method  = typeof(ISpyReturn).GetMethod("ReturnsValueType");
                Dictionary <MethodBase, List <IInterceptionHandler> > dictionary = new Dictionary <MethodBase, List <IInterceptionHandler> >();
                List <IInterceptionHandler> handlers = new List <IInterceptionHandler>();

                handlers.Add(handler);
                dictionary.Add(method, handlers);

                ISpyReturn result   = WrapAndCreateType <ISpyReturn, SpyReturn>(dictionary);
                int        retValue = result.ReturnsValueType();

                Assert.Equal(SpyReturn.ValueReturn, retValue);
            }
            public void Exception()
            {
                RecordingHandler handler = new RecordingHandler();
                MethodBase       method  = typeof(ISpyReturn).GetMethod("Exception");
                Dictionary <MethodBase, List <IInterceptionHandler> > dictionary = new Dictionary <MethodBase, List <IInterceptionHandler> >();
                List <IInterceptionHandler> handlers = new List <IInterceptionHandler>();

                handlers.Add(handler);
                dictionary.Add(method, handlers);

                ISpyReturn result = WrapAndCreateType <ISpyReturn, SpyReturn>(dictionary);

                Assert.Throws <ArgumentException>(delegate
                {
                    result.Exception();
                });
            }
            public void NoReturnValue()
            {
                Recorder.Records.Clear();
                RecordingHandler handler = new RecordingHandler();
                MethodBase       method  = typeof(ISpyReturn).GetMethod("NoReturnValue");
                Dictionary <MethodBase, List <IInterceptionHandler> > dictionary = new Dictionary <MethodBase, List <IInterceptionHandler> >();
                List <IInterceptionHandler> handlers = new List <IInterceptionHandler>();

                handlers.Add(handler);
                dictionary.Add(method, handlers);

                ISpyReturn result = WrapAndCreateType <ISpyReturn, SpyReturn>(dictionary);

                result.NoReturnValue();

                Assert.Equal(3, Recorder.Records.Count);
                Assert.Equal("Before Method", Recorder.Records[0]);
                Assert.Equal("In Method", Recorder.Records[1]);
                Assert.Equal("After Method", Recorder.Records[2]);
            }