NuSelfUpdate.Tests.Helpers.MockFileSystem.AddFile C# (CSharp) Method

AddFile() public method

public AddFile ( string path ) : void
path string
return void
        public virtual void AddFile(string path)
        {
            AddFile(path, new MemoryStream());
        }

Same methods

MockFileSystem::AddFile ( string path, Func getStream ) : void
MockFileSystem::AddFile ( string path, Stream stream ) : void
MockFileSystem::AddFile ( string path, string content ) : void

Usage Example

        void GivenAnApplicationDirectoryContainingAppFiles()
        {
            _installedVersion = new Version(1, 0);
            _builder = new AppUpdaterBuilder(TestConstants.AppPackageId)
                .SetupWithTestValues(_installedVersion);

            _fileSystem = _builder.GetMockFileSystem();

            _appFiles = new[] { "app.exe", "app.exe.config", "nuget.dll", "data.db", "content\\logo.png" };

            foreach (var file in _appFiles)
                _fileSystem.AddFile(Path.Combine(AppDirectory, file), MockFileContent(file, _installedVersion));
        }