コード例 #1
0
		[Test] // .ctor (String)
		public void Constructor1 ()
		{
			InternalsVisibleToAttribute ivt;
			string aname;

			aname = "Mono";
			ivt = new InternalsVisibleToAttribute (aname);
			Assert.IsTrue (ivt.AllInternalsVisible, "#A:AllInternalsVisible");
			Assert.AreSame (aname, ivt.AssemblyName, "#A:AssemblyName");
			Assert.AreEqual (ivt.GetType (), ivt.TypeId, "#A:TypeId");

			aname = typeof (int).Assembly.FullName;
			ivt = new InternalsVisibleToAttribute (aname);
			Assert.IsTrue (ivt.AllInternalsVisible, "#B:AllInternalsVisible");
			Assert.AreSame (aname, ivt.AssemblyName, "#B:AssemblyName");
			Assert.AreEqual (ivt.GetType (), ivt.TypeId, "#B:TypeId");

			aname = string.Empty;
			ivt = new InternalsVisibleToAttribute (aname);
			Assert.IsTrue (ivt.AllInternalsVisible, "#C:AllInternalsVisible");
			Assert.AreSame (aname, ivt.AssemblyName, "#C:AssemblyName");
			Assert.AreEqual (ivt.GetType (), ivt.TypeId, "#C:TypeId");

			aname = null;
			ivt = new InternalsVisibleToAttribute (aname);
			Assert.IsTrue (ivt.AllInternalsVisible, "#D:AllInternalsVisible");
			Assert.IsNull (ivt.AssemblyName, "#D:AssemblyName");
			Assert.AreEqual (ivt.GetType (), ivt.TypeId, "#D:TypeId");
		}
コード例 #2
0
		public void AllInternalsVisible ()
		{
			InternalsVisibleToAttribute ivt = new InternalsVisibleToAttribute ("Mono");
			ivt.AllInternalsVisible = false;
			Assert.IsFalse (ivt.AllInternalsVisible, "#1");
			ivt.AllInternalsVisible = true;
			Assert.IsTrue (ivt.AllInternalsVisible, "#2");
		}
コード例 #3
0
ファイル: InternalsUtil.cs プロジェクト: JohnsonYuan/n2cms
 private static bool VisibleToDynamicProxy(InternalsVisibleToAttribute attribute)
 {
     return attribute.AssemblyName.Contains(ModuleScope.DEFAULT_ASSEMBLY_NAME);
 }