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)); }
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)); }