Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed build

  • Loading branch information...
commit ef7fb2c3bc49884aa8d600f5de891b53309d4378 1 parent 2121b61
@bbaia bbaia authored
View
31 src/Spring.Rest/IO/AssemblyResource.cs
@@ -23,8 +23,6 @@
using System.Globalization;
using System.Reflection;
-using Spring.Util;
-
namespace Spring.IO
{
/// <summary>
@@ -83,35 +81,6 @@ public AssemblyResource(string resourceName)
}
/// <summary>
- /// Creates a new instance of the <see cref="Spring.IO.AssemblyResource"/> class.
- /// Generates the full assembly resource name from a file name and a type used to obtain the assembly name and the namespace.
- /// </summary>
- /// <param name="resourceName">The name of the file in the assembly.</param>
- /// <param name="type">The type to determine the assembly and the namespace.</param>
- /// <exception cref="System.UriFormatException">
- /// If the generated resource name did not conform to the expected format.
- /// </exception>
- /// <exception cref="System.IO.FileNotFoundException">
- /// If the assembly specified in the generated resource name could not be found.
- /// </exception>
- public AssemblyResource(string resourceName, Type type)
- : this(GetFullAssemblyResourceName(resourceName, type))
- {
- }
-
- /// <summary>
- /// Constructs a "assembly://assemblyName/namespace/resourceName" qualified resource name
- /// using the given type to obtain the assembly name and the namespace.
- /// </summary>
- private static string GetFullAssemblyResourceName(string resourceName, Type type)
- {
- ArgumentUtils.AssertHasText(resourceName, "resourceName");
- ArgumentUtils.AssertNotNull(type, "type");
-
- return String.Format("assembly://{0}/{1}/{2}", type.Assembly.GetName().Name, type.Namespace, resourceName);
- }
-
- /// <summary>
/// Gets the <see cref="System.Uri"/> handle for this resource.
/// </summary>
public override Uri Uri
View
11 test/Spring.Rest.Tests/IO/AssemblyResourceTests.cs
@@ -60,7 +60,7 @@ public void CreateFromInvalidAssembly()
/// and ensures the correct contents can be read from them.
/// </summary>
[Test]
- public void CreateValidAssemblyResourceWithFullResourceName()
+ public void CreateValidAssemblyResource()
{
AssemblyResource res = new AssemblyResource("assembly://Spring.Rest.Tests/Spring/TestResource.txt");
Assert.IsFalse(res.IsOpen);
@@ -70,15 +70,6 @@ public void CreateValidAssemblyResourceWithFullResourceName()
AssertResourceContent(res2, "Spring.IO.TestResource.txt");
}
- [Test]
- public void CreateValidAssemblyResourceWithRelativeResourceName()
- {
- AssemblyResource res = new AssemblyResource("TestResource.txt", typeof(AssemblyResourceTests));
- Assert.IsFalse(res.IsOpen);
- Assert.AreEqual(new Uri("assembly://Spring.Rest.Tests/Spring.IO/TestResource.txt"), res.Uri);
- AssertResourceContent(res, "Spring.IO.TestResource.txt");
- }
-
/// <summary>
/// Utility method to compare a resource that contains a single string with an exemplar.
/// </summary>
Please sign in to comment.
Something went wrong with that request. Please try again.