Ejemplo n.º 1
0
        public void StartupWithValidArgsShouldSetRootFolder()
        {
            // Arrange
            var folderValidator = Substitute.For <IFolderValidator>();
            var rootFolder      = @"C:\upictures\pictures";

            string[] args = { rootFolder };
            var      mediaConfigurationManager = new MediaConfigurationManager(args, folderValidator);

            // Act
            mediaConfigurationManager.StartupCheck();

            // Assert
            Assert.Equal(rootFolder, mediaConfigurationManager.RootFolder);
        }
Ejemplo n.º 2
0
        public void StartupWithEmptyArgsShouldReturnFalse()
        {
            // Arrange
            var folderValidator = Substitute.For <IFolderValidator>();

            string[] args = new string[0];
            var      mediaConfigurationManager = new MediaConfigurationManager(args, folderValidator);
            bool     startupResult;

            // Act
            startupResult = mediaConfigurationManager.StartupCheck();

            // Assert
            Assert.Equal(false, startupResult);
        }
Ejemplo n.º 3
0
        public void StartupWithNonExistingRootFolderShouldReturnError()
        {
            // Arrange
            var folderValidator = Substitute.For <IFolderValidator>();

            folderValidator.Exists(Arg.Any <string>()).Returns(false);
            var rootFolder = @"C:\upictures\pictures";

            string[] args = { rootFolder };
            var      mediaConfigurationManager = new MediaConfigurationManager(args, folderValidator);
            bool     startupResult;

            // Act
            startupResult = mediaConfigurationManager.StartupCheck();

            // Assert
            Assert.False(startupResult);
        }