public void FromPath_NullCodebase()
 {
     Assert.Throws(typeof(ArgumentNullException), () =>
     {
         var target = AssemblyTarget.FromPath(null);
     });
 }
 public void FromPath_NonExistingCodeBase()
 {
     Assert.Throws(typeof(FileNotFoundException), () =>
     {
         var location = Path.GetFullPath(string.Format("{0}/{1}", Guid.NewGuid().ToString(), Path.GetRandomFileName()));
         var target   = AssemblyTarget.FromPath(new Uri(location));
     });
 }
        public void FromPath_CurrentAssembly()
        {
            var assembly = Assembly.GetExecutingAssembly();
            var target   = AssemblyTarget.FromPath(new Uri(assembly.CodeBase), assembly.Location, assembly.FullName);

            Assert.NotNull(target);
            Assert.Equal(assembly.CodeBase, target.CodeBase.ToString());
            Assert.Equal(assembly.Location, target.Location);
            Assert.Equal(assembly.FullName, target.FullName);
        }
Example #4
0
 public void FromPath_NonExistingCodeBase()
 {
     var location = Path.GetFullPath(Guid.NewGuid().ToString() + "/" + Path.GetRandomFileName());
     var target   = AssemblyTarget.FromPath(new Uri(location));
 }
Example #5
0
 public void FromPath_NonExistingLocationExistingCodeBase()
 {
     var assembly = Assembly.GetExecutingAssembly();
     var location = Guid.NewGuid().ToString() + "/" + Path.GetRandomFileName();
     var target   = AssemblyTarget.FromPath(new Uri(assembly.CodeBase), location);
 }
Example #6
0
 public void FromPath_NullCodebase()
 {
     var target = AssemblyTarget.FromPath(null);
 }