Example #1
0
		public void Copy () 
		{
			NetCodeGroup cg = new NetCodeGroup (new AllMembershipCondition ());
			NetCodeGroup cg2 = (NetCodeGroup) cg.Copy ();
			Assert.AreEqual (cg.AttributeString, cg2.AttributeString, "AttributeString");
			Assert.AreEqual (cg.Children.Count, cg2.Children.Count, "Children");
			Assert.AreEqual (cg.Description, cg2.Description, "Description");
			Assert.AreEqual (cg.MergeLogic, cg2.MergeLogic, "MergeLogic");
			Assert.AreEqual (cg.Name, cg2.Name, "Name");
			Assert.AreEqual (cg.PermissionSetName, cg2.PermissionSetName, "PermissionSetName");
			Assert.AreEqual (cg.ToXml ().ToString (), cg2.ToXml ().ToString (), "ToXml");
		}
		public void Copy () 
		{
			NetCodeGroup cg = new NetCodeGroup (new AllMembershipCondition ());
			NetCodeGroup cg2 = (NetCodeGroup) cg.Copy ();
			AssertEquals ("AttributeString", cg.AttributeString, cg2.AttributeString);
			AssertEquals ("Children", cg.Children.Count, cg2.Children.Count);
			AssertEquals ("Description", cg.Description, cg2.Description);
			AssertEquals ("MergeLogic", cg.MergeLogic, cg2.MergeLogic);
			AssertEquals ("Name", cg.Name, cg2.Name);
			AssertEquals ("PermissionSetName", cg.PermissionSetName, cg2.PermissionSetName);
			AssertEquals ("ToXml", cg.ToXml ().ToString (), cg2.ToXml ().ToString ());
		}
Example #3
0
		public void CopyWithChildren () 
		{
			NetCodeGroup cgChild = new NetCodeGroup (new AllMembershipCondition ());
			NetCodeGroup cg = new NetCodeGroup (new AllMembershipCondition ());
			cg.AddChild (cgChild);
			NetCodeGroup cg2 = (NetCodeGroup) cg.Copy ();
			Assert.AreEqual (cg.Children.Count, cg2.Children.Count, "Children");
			Assert.AreEqual (cg.ToXml ().ToString (), cg2.ToXml ().ToString (), "ToXml");
		}
Example #4
0
		public void ToFromXmlRoundtrip () 
		{
			NetCodeGroup cg = new NetCodeGroup (new AllMembershipCondition ());
			cg.Name = "SomeName";
			cg.Description = "Some Description";
			Assert.IsTrue (cg.Equals (cg), "Equals (itself)");
			SecurityElement se = cg.ToXml ();

			NetCodeGroup cg2 = new NetCodeGroup (new AllMembershipCondition());
			cg2.Name = "SomeOtherName";
			cg2.Description = "Some Other Description";
			Assert.IsTrue (!cg.Equals (cg2), "Equals (another)");

			cg2.FromXml (se);
			Assert.IsTrue (cg.Equals (cg2), "Equals (FromXml)");
		}