public void SetUp() { content = new MemoryStream(); log = Substitute.For<ILog>(); fileSystem = Substitute.For<IFileSystem>(); configuration = Substitute.For<IConfiguration>(); fileSystemUnified = new FileSystemUnified(log, fileSystem, configuration); }
public void SetUp() { var fakeFiles = CreateFakeFileList(); expectedModificationTime = DateTime.UtcNow; log = Substitute.For<ILog>(); fileSystem = Substitute.For<IFileSystem>(); fileSystem.GetAllFiles("layouts").Returns(fakeFiles); fileSystem.ReadStringFromFile(Path.Combine("layouts", "a.html")).Returns("---\nnum: 1\n---\ntest 1"); fileSystem.ReadStringFromFile(Path.Combine("layouts", "b.html")).Returns("test 2"); fileSystem.ReadStringFromFile(Path.Combine("layouts", "b.yaml")).Returns("num: 2"); fileSystem.GetLastWriteTimeUtc(Arg.Any<string>()).Returns(expectedModificationTime); configuration = Substitute.For<IConfiguration>(); configuration.TextExtensions.Returns(new string[] { "html", "yaml" }); fileSystemUnified = new FileSystemUnified(log, fileSystem, configuration); }
public void SetUp() { var itemContentString = Encoding.UTF8.GetBytes("Item Content"); itemContent = new MemoryStream(itemContentString); var expectedString = Encoding.UTF8.GetBytes(@"--- property1: Property1 property2: Property2 --- Item Content"); expected = new MemoryStream(); expected.Write(expectedString, 0, expectedString.Length); log = Substitute.For<ILog>(); fileSystem = Substitute.For<IFileSystem>(); configuration = Substitute.For<IConfiguration>(); fileSystemUnified = new FileSystemUnified(log, fileSystem, configuration); }