Exemplo n.º 1
0
    public async Task Configure()
    {
        // When
        await _configService.Load();

        // Then
        Assert.NotNull(_configService.Config());
    }
Exemplo n.º 2
0
    public async Task GetSourcePaths()
    {
        // Given
        _configService
        .Config()
        .Returns(
            new JsonConfig
        {
            DryRun        = true,
            IncludeMyPath = true
        });

        var operatingSystemLayerWindows = new OperatingSystemLayerWindows(_configService);

        Assert.NotNull(await operatingSystemLayerWindows.SourcePaths());
    }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
    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);
    }
Exemplo n.º 5
0
    public async Task CreateTargetBaseLocation()
    {
        // Given
        _configService
        .Config()
        .Returns(
            new JsonConfig
        {
            DryRun = true,
            DestinationDirectory = ""
        });
        var operatingSystemLayerLinux = new OperatingSystemLayerLinux(_configService);

        await operatingSystemLayerLinux.CreateTargetBaseLocation();
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
 public FileRipper(IOperatingSystemLayer operatingSystemLayer, IConfigService configService)
 {
     _operatingSystemLayer = operatingSystemLayer;
     _config = configService.Config();
 }
Exemplo n.º 8
0
 public OperatingSystemLayerWindows(IConfigService configService)
 {
     _config = configService.Config();
 }
Exemplo n.º 9
0
 public OperatingSystemLayerLinux(IConfigService configService)
 {
     _config = configService.Config();
 }