GetAssemblyName() public method

public GetAssemblyName ( String assemblyFile ) : AssemblyName
assemblyFile String
return AssemblyName
Esempio n. 1
0
        public static void GetAssemblyName_AssemblyNameProxy()
        {
            AssemblyNameProxy anp = new AssemblyNameProxy();
            Assert.Throws<ArgumentNullException>("assemblyFile", () => anp.GetAssemblyName(null));
            Assert.Throws<ArgumentException>(() => anp.GetAssemblyName(string.Empty));
            Assert.Throws<System.IO.FileNotFoundException>(() => anp.GetAssemblyName("IDontExist"));

            Assembly a = typeof(AssemblyNameTests).Assembly;
            Assert.Equal(new AssemblyName(a.FullName).ToString(), anp.GetAssemblyName(System.IO.Path.GetFullPath(a.Location)).ToString());
        }
Esempio n. 2
0
        public static void GetAssemblyName_AssemblyNameProxy()
        {
            AssemblyNameProxy anp = new AssemblyNameProxy();
            Assert.Throws<ArgumentNullException>("assemblyFile", () => anp.GetAssemblyName(null));
            Assert.Throws<ArgumentException>(() => anp.GetAssemblyName(string.Empty));
            Assert.Throws<FileNotFoundException>(() => anp.GetAssemblyName(Guid.NewGuid().ToString("N")));

            Assembly a = typeof(AssemblyNameProxyTests).Assembly;
            Assert.Equal(new AssemblyName(a.FullName).ToString(), anp.GetAssemblyName(Path.GetFullPath(a.Location)).ToString());
        }