Пример #1
0
 public void GetResourceNameFromInvalidPath()
 {
     Assert.IsNull(EmbeddedResourceHelper.GetResourceNameFromPath(null));
     Assert.IsNull(EmbeddedResourceHelper.GetResourceNameFromPath(string.Empty));
     Assert.IsNull(EmbeddedResourceHelper.GetResourceNameFromPath("folder/file.ext"));
     Assert.IsNull(EmbeddedResourceHelper.GetResourceNameFromPath("/folder/file.ext"));
     Assert.IsNull(EmbeddedResourceHelper.GetResourceNameFromPath("~/folder/file.ext"));
     Assert.IsNull(EmbeddedResourceHelper.GetResourceNameFromPath("~/folder/file.ext" + EmbeddedResource.FILE_EXTENSION));
 }
Пример #2
0
        public void GetResourceNameFromValidPath()
        {
            Assert.AreEqual(
                EmbeddedResource.RESOURCE_PREFIX,
                EmbeddedResourceHelper.GetResourceNameFromPath(EmbeddedResource.ROOT_URL));

            Assert.AreEqual(
                EmbeddedResource.RESOURCE_PREFIX + "folder.file.ext",
                EmbeddedResourceHelper.GetResourceNameFromPath(EmbeddedResource.ROOT_URL + "folder/file.ext"));

            Assert.AreEqual(
                EmbeddedResource.RESOURCE_PREFIX + "folder.file.ext",
                EmbeddedResourceHelper.GetResourceNameFromPath(EmbeddedResource.ROOT_URL + "folder/file.ext" + EmbeddedResource.FILE_EXTENSION));
        }