LoadXDocument() public méthode

Load xml document from a file
public LoadXDocument ( string fileName, bool memoryCache = false ) : System.Xml.Linq.XDocument
fileName string File name
memoryCache bool Load file from memory cache if possible.
Résultat System.Xml.Linq.XDocument
		public void LoadXDocument_CacheEnabledDefaultFile_DefaultFileFromCache()
		{
			// Assign
			FileReader.ClearCache();
			_fs.Setup(x => x.File.Exists(It.Is<string>(d => d == "C:/WebSites/FooSite/App_Data/Foo.ru.xml"))).Returns(false);

			// Act

			_fileReader.LoadXDocument("Foo.xml", true);

			_fileReader = new FileReader(DataPath, "en", _languageManagerProvider.Object);
			_fileReader.Setup();

			var result = _fileReader.LoadXDocument("Foo.xml", true);

			// Assert

			_fs.Verify(x => x.File.ReadAllText(It.IsAny<string>()), Times.Once);
			Assert.AreEqual(XDocument.Parse(
					"<?xml version=\"1.0\" encoding=\"utf-8\" ?><items><item name=\"SiteTitle\" value=\"Title\" /></items>")
					.Root.OuterXml(), result.Root.OuterXml());
		}
		public void LoadXDocument_CacheEnabled_SecondTimeFromCache()
		{
			// Assign
			FileReader.ClearCache();

			// Act

			_fileReader.LoadXDocument("Foo.xml", true);

			_fileReader = new FileReader(DataPath, "en", _languageManagerProvider.Object);
			_fileReader.Setup();

			var result = _fileReader.LoadXDocument("Foo.xml", true);

			// Assert

			_fs.Verify(x => x.File.ReadAllText(It.IsAny<string>()), Times.Once);
			Assert.AreEqual(XDocument.Parse(
					"<?xml version=\"1.0\" encoding=\"utf-8\" ?><items><item name=\"SiteTitle\" value=\"Заголовок\" /></items>")
					.Root.OuterXml(), result.Root.OuterXml());
		}