public async Task Configure() { // When await _configService.Load(); // Then Assert.NotNull(_configService.Config()); }
public async Task GetSourcePaths() { // Given _configService .Config() .Returns( new JsonConfig { DryRun = true, IncludeMyPath = true }); var operatingSystemLayerWindows = new OperatingSystemLayerWindows(_configService); Assert.NotNull(await operatingSystemLayerWindows.SourcePaths()); }
public Searcher(IFileRipper fileRipper, IOperatingSystemLayer operatingSystemLayer, IConfigService configService) { _fileRipper = fileRipper; _operatingSystemLayer = operatingSystemLayer; _config = configService.Config(); _regexes = _config.Patterns.Select(_ => new Regex(_)); _startingPath = _operatingSystemLayer.CurrentPath().Result; }
public void RipLimitReached(int ripCounter, bool expected) { // Given _configService.Config().RipLimit = 10; _searcher.RipCounter = ripCounter; // When var actual = _searcher.RipLimitReached(); // Then Assert.Equal(expected, actual); }
public async Task CreateTargetBaseLocation() { // Given _configService .Config() .Returns( new JsonConfig { DryRun = true, DestinationDirectory = "" }); var operatingSystemLayerLinux = new OperatingSystemLayerLinux(_configService); await operatingSystemLayerLinux.CreateTargetBaseLocation(); }
public SearcherTests() { _configService = Substitute.For <IConfigService>(); _operatingSystemLayer = Substitute.For <IOperatingSystemLayer>(); var fileRipper = Substitute.For <IFileRipper>(); _operatingSystemLayer.CurrentPath().Returns(Dir); _configService .Config() .Returns(new JsonConfig { Patterns = new List <string>() }); _searcher = new Searcher(fileRipper, _operatingSystemLayer, _configService); }
public FileRipper(IOperatingSystemLayer operatingSystemLayer, IConfigService configService) { _operatingSystemLayer = operatingSystemLayer; _config = configService.Config(); }
public OperatingSystemLayerWindows(IConfigService configService) { _config = configService.Config(); }
public OperatingSystemLayerLinux(IConfigService configService) { _config = configService.Config(); }