Exemple #1
0
 protected TagReaderBase(IEventAggregator eventAggregator, IDirectoryHelper directoryHelper,
                         IEnvironmentProxy environmentProxy)
 {
     EventAggregator       = eventAggregator;
     this.directoryHelper  = directoryHelper;
     this.environmentProxy = environmentProxy;
 }
Exemple #2
0
        public void Build_BicepFileWithWarnings_LogsWarnings(IEnvironmentProxy environmentProxy, IFileSystem fileSystem)
        {
            // Arrange.
            var processProxy = MockProcessProxyFactory.CreateProcessProxy(0, "", string.Join('\n', SampleWarnings));
            var mockConsole  = new MockConsole().ExpectOutLines(SampleWarnings.Append(""));

            var sut = CreateBicepCliProxy(environmentProxy, processProxy, fileSystem, console: mockConsole);

            // Act.
            sut.Build("/main.bicep", "main.json");

            // Assert.
            mockConsole.Verify();
        }
Exemple #3
0
        public void Build_ValidBicepFile_DoesNotLogAnyWarningsAndErrors(IEnvironmentProxy environmentProxy, IFileSystem fileSystem)
        {
            // Arrange.
            var processProxy = MockProcessProxyFactory.CreateProcessProxy(0, "", "");
            var mockConsole  = new MockConsole();

            var sut = CreateBicepCliProxy(environmentProxy, processProxy, fileSystem, console: mockConsole);

            // Act.
            sut.Build("/main.bicep", "main.json");

            // Assert.
            mockConsole.Verify();
        }
 public ExtractSaveOperation(
     IConverterOptions options,
     ICompressedSaveChecker saveChecker,
     IZipFileHelper zipFileHelper,
     IEnvironmentProxy environmentProxy,
     IFileProxy fileProxy,
     IFolderProxy folderProxy)
 {
     this.options = options;
     this.saveChecker = saveChecker;
     this.zipFileHelper = zipFileHelper;
     this.environmentProxy = environmentProxy;
     _fileProxy = fileProxy;
     _folderProxy = folderProxy;
 }
Exemple #5
0
 public ExtractSaveOperation(
     IConverterOptions options,
     ICompressedSaveChecker saveChecker,
     IZipFileHelper zipFileHelper,
     IEnvironmentProxy environmentProxy,
     IFileProxy fileProxy,
     IFolderProxy folderProxy)
 {
     this.options          = options;
     this.saveChecker      = saveChecker;
     this.zipFileHelper    = zipFileHelper;
     this.environmentProxy = environmentProxy;
     _fileProxy            = fileProxy;
     _folderProxy          = folderProxy;
 }
Exemple #6
0
 public CommandHandler(IEnvironmentProxy environmentProxy, IProcessProxy processProxy, IFileSystem fileSystem, ILogger <ValidateCommand> logger)
     : base(fileSystem, logger)
 {
     this.environmentProxy = environmentProxy;
     this.processProxy     = processProxy;
 }
Exemple #7
0
        public void Build_BicepFileWithWarningsAndErrors_LogsWarningAndErrorAndThrowsException(IEnvironmentProxy environmentProxy, IFileSystem fileSystem)
        {
            // Arrange.
            var mockProcessProxy = MockProcessProxyFactory.CreateProcessProxy(1, "", string.Join('\n', SampleWarnings.Concat(SampleErrors)));
            var mockConsole      = new MockConsole()
                                   .ExpectOutLines(SampleWarnings)
                                   .ExpectErrorLines(SampleErrors);

            var sut = CreateBicepCliProxy(environmentProxy, mockProcessProxy, fileSystem, console: mockConsole);

            // Act & Assert.
            FluentActions.Invoking(() => sut.Build("/main.bicep", "/main.json")).Should()
            .Throw <BicepException>()
            .WithMessage("Failed to build \"/main.bicep\".");

            mockConsole.Verify();
        }