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