예제 #1
0
        public void AddFromFileCopy_AddExistingFileNameInsideProjectFolder_ProjectUpdaterIsDisposed()
        {
            CreateProjectItems(@"d:\projects\myproject\myproject.csproj");
            IProjectBrowserUpdater projectBrowserUpdater = CreateProjectBrowserUpdater();
            string fileName = @"d:\projects\myproject\test.cs";

            fakeFileService.ExistingFileNames.Add(fileName);

            projectItems.AddFromFileCopy(fileName);

            projectBrowserUpdater.AssertWasCalled(updater => updater.Dispose());
        }
예제 #2
0
        public void AddFromDirectory_EmptyDirectoryInsideProject_ProjectBrowserUpdaterIsDisposed()
        {
            CreateProjectItems(@"d:\projects\myproject\myproject.csproj");
            IProjectBrowserUpdater projectBrowserUpdater = CreateProjectBrowserUpdater();
            string directory = @"d:\projects\myproject\tools";

            projectItems.AddFromDirectory(directory);

            bool saved = msbuildProject.IsSaved;

            projectBrowserUpdater.AssertWasCalled(updater => updater.Dispose());
        }
예제 #3
0
        public void AddFromFile_FullFileNameIsInsideProject_ProjectBrowserUpdaterIsDisposed()
        {
            CreateProjectItems();
            IProjectBrowserUpdater projectBrowserUpdater = CreateProjectBrowserUpdater();

            msbuildProject.FileName = @"d:\projects\myproject\myproject.csproj";
            string fileName = @"d:\projects\myproject\tools\test.cs";

            msbuildProject.ItemTypeToReturnFromGetDefaultItemType = ItemType.Page;
            projectItems.AddFromFile(fileName);

            projectBrowserUpdater.AssertWasCalled(updater => updater.Dispose());
        }
예제 #4
0
        public void AddFromFile_AddFromFileFromProjectItemsBelongingToFile_ProjectBrowserUpdaterIsDisposed()
        {
            string projectFileName = @"d:\projects\myproject\MyProject.csproj";

            CreateProjectWithOneFileInProjectFolder("MainForm.cs", projectFileName);
            IProjectBrowserUpdater projectBrowserUpdater = CreateProjectBrowserUpdater();

            CreateFileProjectItemsFromFileInProjectFolder("MainForm.cs");
            string fileName = @"d:\projects\myproject\MainForm.Designer.cs";

            fileProjectItems.AddFromFile(fileName);

            projectBrowserUpdater.AssertWasCalled(updater => updater.Dispose());
        }