コード例 #1
0
        public void SaveWorkspaceAtShutdown()
        {
            IWorkspaceStorage workspaceStorage = MockRepository.GenerateMock <IWorkspaceStorage>();

            StumpApplication app = new StumpApplication(workspaceStorage);

            workspaceStorage.Expect(ws => ws.SaveWorkspace(app.Workspace));

            app.Shutdown();

            workspaceStorage.VerifyAllExpectations();
        }
コード例 #2
0
        public void LoadWorkspaceAtStartup()
        {
            IWorkspaceStorage workspaceStorage = MockRepository.GenerateMock <IWorkspaceStorage>();
            Workspace         workspace        = new Workspace();

            workspaceStorage.Expect(ws => ws.LoadWorkspace()).Return(workspace);

            StumpApplication app = new StumpApplication(workspaceStorage);

            app.Start();

            Assert.IsNotNull(app.Workspace);
            workspaceStorage.VerifyAllExpectations();
        }