示例#1
0
        public Diagram(IDiagramController content)
        {
            if (content == null)
            {
                throw new ArgumentNullResourceException("content", Resources.General_Given_Parameter_Cannot_Be_Null);
            }

            this.Id = Guid.NewGuid();
            this.Controller = content;
            this.Controller.SetHostDiagram(this);
            content.DiagramLoaded += this.OnDiagramLoaded;

            this.ContentHeight = MinimumDiagramDimensionY;
            this.ContentWidth = MinimumDiagramDimensionX;
            this.ContentScale = 1;
        }
        public void TestInitialise()
        {
            this.factory = new Container();
            this.mockFileManager = MockRepository.GenerateMock<IFileManager>();

            this.mockController = MockRepository.GenerateMock<IDiagramController>();
            this.fakeDiagram = new Diagram(this.mockController);

            factory.Configure(config => config.For<IFileManager>().Use(this.mockFileManager));

            this.mockFileManager.Expect(m => m.LoadDemoType()).IgnoreArguments().Return(demoType);

            var harness = new ShellControllerTestHarness(factory)
                              {
                                  CreateController = () => this.mockController,
                                  CurrentView = this.fakeDiagram,
                              };
            this.target = harness;
        }