SIL.Utils.MockFileOS.MakeFile C# (CSharp) Method

MakeFile() public method

Adds a new "temp" file (with fully-qualified path and name) to the collection of files and sets its contents so it can be read. Encoding will be UTF8.
public MakeFile ( string contents ) : string
contents string The contents of the file
return string
		public string MakeFile(string contents)
		{
			return MakeFile(contents, Encoding.UTF8);
		}

Same methods

MockFileOS::MakeFile ( string contents, Encoding encoding ) : string

Usage Example

Ejemplo n.º 1
0
        public void AreFilesIdentical()
        {
            MockFileOS fileOs = new MockFileOS();
            string     junk1  = fileOs.MakeFile("bla", Encoding.Default);
            string     junk2  = fileOs.MakeFile("bla", Encoding.Default);
            string     junk3  = fileOs.MakeFile("alb", Encoding.Default);

            FileUtils.Manager.SetFileAdapter(fileOs);
            try
            {
                Assert.IsTrue(FileUtils.AreFilesIdentical(junk1, junk2));
                Assert.IsFalse(FileUtils.AreFilesIdentical(junk1, junk3));
            }
            finally
            {
                FileUtils.Manager.Reset();
            }
        }
All Usage Examples Of SIL.Utils.MockFileOS::MakeFile