private static IEnumerable <object[]> GetSuccessData()
        {
            yield return(new object[]
            {
                MockFileSystemFactory.CreateFileSystemWithEmptyFolder(),
                MockFileSystemFactory.CreateFileSystemWithEmptyGeneratedFiles(),
            });

            yield return(new object[]
            {
                MockFileSystemFactory.CreateFileSystemWithNewFiles(),
                MockFileSystemFactory.CreateFileSystemWithNewGeneratedFiles(),
            });

            yield return(new object[]
            {
                MockFileSystemFactory.CreateFileSystemWithModifiedFiles(),
                MockFileSystemFactory.CreateFileSystemWithModifiedGeneratedFiles(),
            });

            yield return(new object[]
            {
                // Generate valid files should not change the ARM template parameters file.
                MockFileSystemFactory.CreateFileSystemWithValidFiles(),
                MockFileSystemFactory.CreateFileSystemWithValidFiles(),
            });
        }
        public void Invoke_BicepBuildError_ReturnsOne()
        {
            var fileSystem   = MockFileSystemFactory.CreateFileSystemWithNewFiles();
            var processProxy = MockProcessProxyFactory.CreateProcessProxy(exitCode: 1, standardError: "Build error.");

            var exitCode = Invoke(fileSystem, processProxy);

            exitCode.Should().Be(1);
        }
        public void Invoke_BicepBuildError_WritesErrorsToConsole()
        {
            var fileSystem   = MockFileSystemFactory.CreateFileSystemWithNewFiles();
            var processProxy = MockProcessProxyFactory.CreateProcessProxy(exitCode: 1, standardError: "Build error one.\nBuild error two.");
            var console      = new MockConsole().ExpectErrorLines("Build error one.", "Build error two.", $"Failed to build \"{fileSystem.Path.GetFullPath(MainBicepFile.FileName)}\".");

            Invoke(fileSystem, processProxy, console);

            console.Verify();
        }