コード例 #1
0
ファイル: AssemblyReaderTests.cs プロジェクト: danaxa/Pencil
        static IAssembly GetSingleTypeAssembly()
        {
            var type = new TypeStub("MyType");
            var method = new MethodStub("DoStuff");
            type.GetMethodsHandler = () => new[]{ method };

            return GetAssemblyWithTypes(type);
        }
コード例 #2
0
ファイル: DefaultHandlerTests.cs プロジェクト: danaxa/Pencil
        public void Should_remember_current_method()
        {
            var handler = new TestHandler();
            IMethod activeMethod = null;
            handler.OnBeginMethod = x => activeMethod = x;

            var method = new MethodStub("DoStuff");
            handler.BeginMethod(method);

            activeMethod.ShouldBeSameAs(method);
        }