public void Setup()
        {
            mr              = new MockRepository();
            services        = new ServiceContainer();
            declarationForm = mr.Stub <IDeclarationForm>();
            textBox         = new FakeTextBox();
            declarationForm.Stub(f => f.TextBox).Return(textBox);
            declarationForm.Stub(f => f.ShowAt(new Point()));
            declarationForm.Stub(f => f.Hide());
            declarationForm.Stub(f => f.Dispose());
            var dlgFactory = mr.Stub <IDialogFactory>();

            dlgFactory.Stub(f => f.CreateDeclarationForm()).Return(declarationForm);
            services.AddService <IDialogFactory>(dlgFactory);
            mr.ReplayAll();
            interactor = new DeclarationFormInteractor(services);
            var mem        = new MemoryArea(Address32.Ptr32(0x10), new byte[40]);
            var seg        = new ImageSegment(".text", mem, AccessMode.ReadWrite);
            var segmentMap = new SegmentMap(Address32.Ptr32(0x05), seg);
            var arch       = new X86ArchitectureFlat32();
            var platform   = new Win32Platform(null, arch);

            program          = new Program(segmentMap, arch, platform);
            program.ImageMap = segmentMap.CreateImageMap();
        }
예제 #2
0
        public void Setup()
        {
            services        = new ServiceContainer();
            declarationForm = new Mock <IDeclarationForm>();
            textBox         = new FakeTextBox();
            declarationForm.Setup(f => f.TextBox).Returns(textBox);
            declarationForm.Setup(f => f.ShowAt(new Point()));
            declarationForm.Setup(f => f.Hide());
            declarationForm.Setup(f => f.Dispose());
            declarationForm.SetupProperty(f => f.HintText);
            var dlgFactory = new Mock <IDialogFactory>();

            dlgFactory.Setup(f => f.CreateDeclarationForm()).Returns(declarationForm.Object);
            services.AddService <IDialogFactory>(dlgFactory.Object);

            interactor = new DeclarationFormInteractor(services);
            var mem        = new MemoryArea(Address.Ptr32(0x10), new byte[40]);
            var seg        = new ImageSegment(".text", mem, AccessMode.ReadWrite);
            var segmentMap = new SegmentMap(Address.Ptr32(0x05), seg);
            var arch       = new X86ArchitectureFlat32(services, "x86-protected-32");
            var platform   = new Win32Platform(services, arch);

            program          = new Program(segmentMap, arch, platform);
            program.ImageMap = segmentMap.CreateImageMap();
        }
        public void Setup()
        {
            services    = new ServiceContainer();
            commentForm = new Mock <IDeclarationForm>();
            textBox     = new FakeTextBox();
            commentForm.Setup(f => f.TextBox).Returns(textBox);
            commentForm.Setup(f => f.ShowAt(new Point()));
            commentForm.Setup(f => f.Hide());
            commentForm.Setup(f => f.Dispose());
            commentForm.SetupProperty(f => f.HintText);
            var dlgFactory = new Mock <IDialogFactory>();

            dlgFactory
            .Setup(f => f.CreateCommentForm())
            .Returns(commentForm.Object);
            services.AddService <IDialogFactory>(dlgFactory.Object);
            interactor = new CommentFormInteractor(services);
            program    = new Program();
        }
예제 #4
0
        public void Setup()
        {
            mr          = new MockRepository();
            services    = new ServiceContainer();
            commentForm = mr.Stub <IDeclarationForm>();
            textBox     = new FakeTextBox();
            commentForm.Stub(f => f.TextBox).Return(textBox);
            commentForm.Stub(f => f.ShowAt(new Point()));
            commentForm.Stub(f => f.Hide());
            commentForm.Stub(f => f.Dispose());
            var dlgFactory = mr.Stub <IDialogFactory>();

            dlgFactory
            .Stub(f => f.CreateCommentForm())
            .Return(commentForm);
            services.AddService <IDialogFactory>(dlgFactory);
            mr.ReplayAll();
            interactor = new CommentFormInteractor(services);
            program    = new Program();
        }