예제 #1
0
 public void EscapingOnWindowsWorks(string contents, string bazelout, string ideOut)
 {
     MakeContext(true);
     _fixer    = new RestoreFixer(_context, _files.Object, new WindowsPaths());
     _contents = contents;
     Fix();
     _bazelOut.Should().Be(bazelout);
     _ideOut.Should().Be(ideOut);
 }
예제 #2
0
        public RestoreFixerTests()
        {
            _files = new Mock <Files>();
            MakeContext(false);

            _fixer = new RestoreFixer(_context, _files.Object,
                                      new Paths());
            _files.Setup(f => f.GetContents(It.IsAny <string>())).Returns(() => _contents);

            var c = Path.DirectorySeparatorChar;

            _bazelOutStream = new UnclosableMemoryStream();
            _ideOutStream   = new UnclosableMemoryStream();
            _files.Setup(f => f.Create(It.IsAny <string>()))
            .Returns <string>(path => path.Contains($"{c}_{c}") ? _bazelOutStream : _ideOutStream);
        }