コード例 #1
0
        /// <summary>
        /// Create a new instance of this class
        /// </summary>
        /// <param name="view">The view to use</param>
        /// <param name="project">The project to use</param>
        public FileTreeController(IFileTreeView view, ICalidusProjectModel project)
        {
            _view = view;

            _project = project;

            _view.DisplaySourceFiles(_project.GetAllSourceFiles());
        }
コード例 #2
0
        public void FileTreeControllerShouldCallViewDisplaySourceFiles()
        {
            IList <String> files = new List <String>();

            files.Add(@"C:\one.cs");
            files.Add(@"C:\two.cs");

            IFileTreeView        view  = Mocker.DynamicMock <IFileTreeView>();
            ICalidusProjectModel model = Mocker.DynamicMock <ICalidusProjectModel>();

            Expect.Call(model.GetAllSourceFiles()).Return(files).Repeat.Once();
            Expect.Call(() => view.DisplaySourceFiles(files)).Repeat.Once();

            Mocker.ReplayAll();

            FileTreeController controller = new FileTreeController(view, model);

            Mocker.VerifyAll();
        }