public void When_TryGetFileInfo_and_resource_does_not_exist_then_should_not_get_file_info() { var provider = new EmbeddedResourceFileSystem(this.GetType().Assembly, ""); IFileInfo fileInfo; provider.TryGetFileInfo("/DoesNotExist.Txt", out fileInfo).ShouldBe(false); fileInfo.ShouldBe(null); }
public void When_TryGetFileInfo_and_resources_in_path_then_should_get_file_infos() { var provider = new EmbeddedResourceFileSystem(this.GetType().Assembly, ""); IFileInfo fileInfo; provider.TryGetFileInfo("/Resources/File.txt", out fileInfo).ShouldBe(true); fileInfo.ShouldNotBe(null); fileInfo.LastModified.ShouldNotBe(default(DateTime)); fileInfo.Length.ShouldBeGreaterThan(0); fileInfo.IsDirectory.ShouldBe(false); fileInfo.PhysicalPath.ShouldBe(null); fileInfo.Name.ShouldBe("Resources/File.txt"); }