示例#1
0
        public static void GetAssemblyName_AssemblyNameProxy()
        {
            AssemblyNameProxy anp = new AssemblyNameProxy();

            AssertExtensions.Throws <ArgumentNullException>("assemblyFile", () => anp.GetAssemblyName(null));
            AssertExtensions.Throws <ArgumentException>("path", null, () => 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());
        }
示例#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 <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());
        }