public FromXml ( SecurityElement esd ) : void | ||
esd | SecurityElement | |
return | void |
public void FromXml_WrongVersion () { SecurityPermission sp = new SecurityPermission (PermissionState.None); SecurityElement se = sp.ToXml (); se.Attributes.Remove ("version"); se.Attributes.Add ("version", "2"); sp.FromXml (se); }
public void FromXml_NoVersion () { SecurityPermission sp = new SecurityPermission (PermissionState.None); SecurityElement se = sp.ToXml (); SecurityElement w = new SecurityElement (se.Tag); w.AddAttribute ("class", se.Attribute ("class")); sp.FromXml (w); }
public void FromXml_NoClass () { SecurityPermission sp = new SecurityPermission (PermissionState.None); SecurityElement se = sp.ToXml (); SecurityElement w = new SecurityElement (se.Tag); w.AddAttribute ("version", se.Attribute ("version")); sp.FromXml (w); // doesn't even care of the class attribute presence }
public void FromXml_WrongClass () { SecurityPermission sp = new SecurityPermission (PermissionState.None); SecurityElement se = sp.ToXml (); SecurityElement w = new SecurityElement (se.Tag); w.AddAttribute ("class", "Wrong" + se.Attribute ("class")); w.AddAttribute ("version", se.Attribute ("version")); sp.FromXml (w); // doesn't care of the class name at that stage // anyway the class has already be created so... }
public void FromXml_WrongTagCase () { SecurityPermission sp = new SecurityPermission (PermissionState.None); SecurityElement se = sp.ToXml (); se.Tag = "IPERMISSION"; // instead of IPermission sp.FromXml (se); }
public void FromXml_WrongTag () { SecurityPermission sp = new SecurityPermission (PermissionState.None); SecurityElement se = sp.ToXml (); se.Tag = "IMono"; sp.FromXml (se); }
public void FromXml_Null () { SecurityPermission sp = new SecurityPermission (PermissionState.None); sp.FromXml (null); }