CopyEmbeddedResourceToPath() публичный статический Метод

Copies the embedded resource with the given name to the given path on disk.
public static CopyEmbeddedResourceToPath ( string name, string path ) : void
name string The name of the resource file top copy.
path string The path to copy the file to.
Результат void
Пример #1
0
        public void ExamplesTailLongLines()
        {
            string path = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".txt";

            ApplicationUtils.CopyEmbeddedResourceToPath("TailTest-LongLines.txt", path);

            IList <string> tail = Tail.Read(path, 1, Encoding.UTF8).ToList();

            Assert.AreEqual(1, tail.Count);
            Assert.AreEqual("Cras ultrices, risus ut dictum suscipit, felis diam porta risus, non commodo eros neque vitae leo. Suspendisse condimentum suscipit urna, eget iaculis risus tempus vitae. Praesent luctus, magna ac feugiat euismod, enim dolor mattis sapien, eu mattis libero arcu vitae sem. Fusce eu erat ac metus gravida sodales a id tellus. Donec lacinia facilisis commodo. Vestibulum rhoncus aliquam arcu a varius. Pellentesque elementum egestas dictum. Ut orci nibh, imperdiet eget accumsan quis, pellentesque vel orci. Aliquam aliquam odio eu nulla bibendum mollis. Praesent enim turpis, volutpat at molestie vel, tincidunt id neque. In hac habitasse platea dictumst. Sed sit amet sapien eros. Sed consequat sem eu nunc vulputate sollicitudin. Sed ut suscipit augue. Phasellus rhoncus mauris et odio vulputate a placerat velit vestibulum. Vivamus eleifend augue sit amet libero bibendum lacinia. In faucibus, ante vel commodo bibendum, erat mi venenatis diam, sit amet laoreet libero quam ac nibh. Quisque porta volutpat lectus a luctus. Curabitur euismod pellentesque diam a placerat. Fusce dui velit, mollis in porttitor et, ullamcorper eu lacus. Aliquam vel diam in lorem dictum pellentesque in imperdiet nisi. Proin pretium ipsum in est eleifend quis ultrices orci ultrices. Morbi facilisis, libero non vulputate adipiscing, purus purus fermentum orci, non porttitor neque arcu eu arcu. Quisque eget tortor quam. Aenean risus nunc, ornare quis luctus ut, condimentum nec leo. Suspendisse quis magna non dui semper facilisis a eu nisi.", tail[0]);
        }
Пример #2
0
        public void ExamplesTailAbc()
        {
            string path = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".txt";

            ApplicationUtils.CopyEmbeddedResourceToPath("TailTest-Abc.txt", path);

            IList <string> tail = Tail.Read(path, 0, Encoding.UTF8).ToList();

            Assert.AreEqual(2, tail.Count);
            Assert.AreEqual("Fghi", tail[0]);
            Assert.AreEqual("Abcde", tail[1]);
        }
Пример #3
0
        public void ExamplesTailSuperset()
        {
            string path = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".txt";

            ApplicationUtils.CopyEmbeddedResourceToPath("TailTest-10.txt", path);

            IList <string> tail = Tail.Read(path, 100, Encoding.UTF8).ToList();

            Assert.AreEqual(10, tail.Count);
            Assert.AreEqual("Donec orci odio, vehicula ac convallis non, consectetur sed augue.", tail[0]);
            Assert.AreEqual("Lorem ipsum dolor sit amet, consectetur adipiscing elit.", tail[9]);
        }
Пример #4
0
        public void ExamplesTailSubset()
        {
            string path = Path.GetFileNameWithoutExtension(Path.GetRandomFileName()) + ".txt";

            ApplicationUtils.CopyEmbeddedResourceToPath("TailTest-10.txt", path);

            IList <string> tail = Tail.Read(path, 3, Encoding.UTF8).ToList();

            Assert.AreEqual(3, tail.Count);
            Assert.AreEqual("Donec orci odio, vehicula ac convallis non, consectetur sed augue.", tail[0]);
            Assert.AreEqual("Mauris vitae nibh odio.", tail[1]);
            Assert.AreEqual("Mauris id diam ac nulla suscipit faucibus non non orci.", tail[2]);
        }