Beispiel #1
0
        public void can_find_resource_with_full_name()
        {
            string found = EmbededResourceHelper.FindByName(TestAssembly,
                                                            "AutoHotkey.Interop.Tests.Util.file.txt");

            Assert.Equal("AutoHotkey.Interop.Tests.Util.file.txt", found);
        }
Beispiel #2
0
        public void returns_null_on_partial_folder_name()
        {
            //not Util/file.txt
            string found = EmbededResourceHelper.FindByName(TestAssembly, "Util/file.txt");

            Assert.Null(found);
        }
        public void Returns_null_on_partial_folder_name()
        {
            //not Util/file.txt
            var found = EmbededResourceHelper.FindByName(_testAssembly, "til/file.txt");

            Assert.IsNull(found);
        }
Beispiel #4
0
        public void can_extract_resouce_to_file()
        {
            string testOutputFile   = "extract1.txt";
            string fullResourceName = EmbededResourceHelper.FindByName(TestAssembly, "file.txt");

            EmbededResourceHelper.ExtractToFile(TestAssembly, fullResourceName, testOutputFile);

            string testFileContent     = File.ReadAllText("extract1.txt");
            string expectedFileContent = "this is a test file.";

            Assert.Equal(expectedFileContent, testFileContent);
        }
Beispiel #5
0
        public void retuns_null_for_missing()
        {
            string name = EmbededResourceHelper.FindByName(TestAssembly, "missingfile.txt");

            Assert.Null(name);
        }
Beispiel #6
0
        public void can_find_resource_with_folder_and_file_name()
        {
            string name = EmbededResourceHelper.FindByName(TestAssembly, "Util/file.txt");

            Assert.Equal("AutoHotkey.Interop.Tests.Util.file.txt", name);
        }
        public void Returns_null_for_missing()
        {
            var name = EmbededResourceHelper.FindByName(_testAssembly, "missingfile.txt");

            Assert.IsNull(name);
        }
        public void Can_find_resource_with_only_file_name()
        {
            var name = EmbededResourceHelper.FindByName(_testAssembly, "file.txt");

            Assert.AreEqual("AutoHotkey.Interop.Tests.Util.file.txt", name);
        }