public void ReturnsError_WhenSafeBasePath_MapsToTheEmptyString(string basePath)
        {
            // Arrange
            var expectedError = $"Base path '{basePath}' must contain non '.' characters.";

            var errorMessages = new List <string>();
            var buildEngine   = new Mock <IBuildEngine>();

            buildEngine.Setup(e => e.LogErrorEvent(It.IsAny <BuildErrorEventArgs>()))
            .Callback <BuildErrorEventArgs>(args => errorMessages.Add(args.Message));

            var task = new GetDefaultStaticWebAssetsBasePath
            {
                BuildEngine = buildEngine.Object,
                BasePath    = basePath
            };

            // Act
            var result = task.Execute();

            // Assert
            Assert.False(result);
            var message = Assert.Single(errorMessages);

            Assert.Equal(expectedError, message);
        }
        public void ReturnsSafeBasePath_WhenBasePath_ContainsUnsafeCharacters(string basePath, string expectedSafeBasePath)
        {
            // Arrange
            var task = new GetDefaultStaticWebAssetsBasePath
            {
                BuildEngine = Mock.Of <IBuildEngine>(),
                BasePath    = basePath
            };

            // Act
            var result = task.Execute();

            // Assert
            Assert.True(result);
            Assert.Equal(expectedSafeBasePath, task.SafeBasePath);
        }