Exemplo n.º 1
0
        public void OpenReadMeFile_PackageInstalledWithReadmeTxtButFileDoesNotExistOnFileSystem_ReadmeTxtIsNotOpened()
        {
            const string installPath    = @"d:\projects\myproject\packages\Test.1.2.0";
            string       readmeFileName = Path.Combine(installPath, "readme.txt");

            using (OpenPackageReadMeMonitor monitor = CreateMonitor("Test")) {
                FakePackage package         = CreatePackageWithFile("Test", "readme.txt");
                PackageOperationEventArgs e = CreatePackageInstallEventWithFile(installPath, package);
                project.FirePackageInstalledEvent(e);
                monitor.OpenReadMeFile();
            }

            Assert.IsFalse(fileService.IsOpenFileCalled);
        }
Exemplo n.º 2
0
        public void OpenReadMeFile_PackageDependencyIsInstalledWithReadmeTxt_ReadmeTxtIsNotOpened()
        {
            const string installPath        = @"d:\projects\myproject\packages\Test.Dependency.1.2.0";
            string       expectedFileOpened = Path.Combine(installPath, "readme.txt");

            using (OpenPackageReadMeMonitor monitor = CreateMonitor("Test")) {
                fileService.ExistingFileNames.Add(expectedFileOpened);
                FakePackage package         = CreatePackageWithFile("Test.Dependency", "readme.txt");
                PackageOperationEventArgs e = CreatePackageInstallEventWithFile(installPath, package);
                project.FirePackageInstalledEvent(e);
                monitor.OpenReadMeFile();
            }

            Assert.IsFalse(fileService.IsOpenFileCalled);
        }
Exemplo n.º 3
0
        public void OpenReadMeFile_PackageDependencyIsInstalledWithReadmeTxtWithDifferentCase_ReadmeTxtIsOpened()
        {
            const string installPath        = @"d:\projects\myproject\packages\Test.1.2.0";
            string       expectedFileOpened = Path.Combine(installPath, "ReadMe.TXT");

            using (OpenPackageReadMeMonitor monitor = CreateMonitor("Test")) {
                fileService.ExistingFileNames.Add(expectedFileOpened);
                FakePackage package         = CreatePackageWithFile("Test", "ReadMe.TXT");
                PackageOperationEventArgs e = CreatePackageInstallEventWithFile(installPath, package);
                project.FirePackageInstalledEvent(e);
                monitor.OpenReadMeFile();
            }

            Assert.AreEqual(expectedFileOpened, fileService.FileNamePassedToOpenFile);
        }