GetPrePackagingFolderPath() public méthode

public GetPrePackagingFolderPath ( ) : string
Résultat string
        public void GetPrePackagingFolderPath_DirectoryExistsIsCalled()
        {
            // Arrange
            bool directoryExistsGotCalled = false;

            var applicationInformation = ApplicationInformationProvider.GetApplicationInformation();

            var filesystemAccessorMock = new Mock<IFilesystemAccessor>();
            filesystemAccessorMock.Setup(f => f.DirectoryExists(applicationInformation.PrePackagingFolder)).Returns(
                () =>
                    {
                        directoryExistsGotCalled = true;
                        return true;
                    });

            var prePackagingFolderPathProvider = new PrePackagingFolderPathProvider(applicationInformation, filesystemAccessorMock.Object);

            // Act
            prePackagingFolderPathProvider.GetPrePackagingFolderPath();

            // Assert
            Assert.IsTrue(directoryExistsGotCalled);
        }
        public void GetPrePackagingFolderPath_FolderExists_FolderIsDeletedAndThenCreated()
        {
            // Arrange
            bool deleteDirectoryGotCalled = false;
            bool createDirectoryGotCalled = false;

            var applicationInformation = ApplicationInformationProvider.GetApplicationInformation();

            var filesystemAccessorMock = new Mock<IFilesystemAccessor>();
            filesystemAccessorMock.Setup(f => f.DirectoryExists(applicationInformation.PrePackagingFolder)).Returns(true);
            filesystemAccessorMock.Setup(f => f.DeleteDirectory(applicationInformation.PrePackagingFolder)).Returns(
                () =>
                {
                    deleteDirectoryGotCalled = true;
                    return true;
                });
            filesystemAccessorMock.Setup(f => f.CreateDirectory(applicationInformation.PrePackagingFolder)).Returns(
                () =>
                {
                    createDirectoryGotCalled = true;
                    return true;
                });

            var prePackagingFolderPathProvider = new PrePackagingFolderPathProvider(applicationInformation, filesystemAccessorMock.Object);

            // Act
            prePackagingFolderPathProvider.GetPrePackagingFolderPath();

            // Assert
            Assert.IsTrue(deleteDirectoryGotCalled);
            Assert.IsTrue(createDirectoryGotCalled);
        }
        public void GetPrePackagingFolderPath_ResultEqulsFolderSpecifiedByTheApplicationInformationPrePackagingFolderProperty()
        {
            // Arrange
            var applicationInformation = ApplicationInformationProvider.GetApplicationInformation();
            var filesystemAccessorMock = new Mock<IFilesystemAccessor>();
            filesystemAccessorMock.Setup(f => f.DirectoryExists(It.IsAny<string>())).Returns(true);

            var prePackagingFolderPathProvider = new PrePackagingFolderPathProvider(applicationInformation, filesystemAccessorMock.Object);

            // Act
            var result = prePackagingFolderPathProvider.GetPrePackagingFolderPath();

            // Assert
            Assert.AreEqual(applicationInformation.PrePackagingFolder, result);
        }