Exemplo n.º 1
0
		public void FromXml_NoVersion ()
		{
			PrintingPermission pp = new PrintingPermission (PermissionState.None);
			SecurityElement se = pp.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("class", se.Attribute ("class"));
			pp.FromXml (w);
		}
Exemplo n.º 2
0
		public void FromXml_WrongVersion ()
		{
			PrintingPermission pp = new PrintingPermission (PermissionState.None);
			SecurityElement se = pp.ToXml ();
			se.Attributes.Remove ("version");
			se.Attributes.Add ("version", "2");
			pp.FromXml (se);
		}
Exemplo n.º 3
0
		public void FromXml_NoClass ()
		{
			PrintingPermission pp = new PrintingPermission (PermissionState.None);
			SecurityElement se = pp.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("version", se.Attribute ("version"));
			pp.FromXml (w);
			// note: normally IPermission classes (in corlib) DO NOT care about
			// attribute "class" name presence in the XML
		}
Exemplo n.º 4
0
		public void FromXml_WrongClass ()
		{
			PrintingPermission pp = new PrintingPermission (PermissionState.None);
			SecurityElement se = pp.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("class", "Wrong" + se.Attribute ("class"));
			w.AddAttribute ("version", se.Attribute ("version"));
			pp.FromXml (w);
			// doesn't care of the class name at that stage
			// anyway the class has already be created so...
		}
Exemplo n.º 5
0
		public void FromXml_WrongTagCase ()
		{
			PrintingPermission pp = new PrintingPermission (PermissionState.None);
			SecurityElement se = pp.ToXml ();
			se.Tag = "IPERMISSION"; // instead of IPermission
			pp.FromXml (se);
			// note: normally IPermission classes (in corlib) DO care about the
			// IPermission tag
		}
Exemplo n.º 6
0
		public void FromXml_Null ()
		{
			PrintingPermission pp = new PrintingPermission (PermissionState.None);
			pp.FromXml (null);
		}