private static void AssertObligationExpressionEqual(XacmlObligationExpression expected, XacmlObligationExpression actual) { Assert.NotNull(actual); Assert.NotNull(expected); Assert.Equal(expected.ObligationId.OriginalString, actual.ObligationId.OriginalString); Assert.Equal(expected.FulfillOn, actual.FulfillOn); AssertCollections(expected.AttributeAssignmentExpressions, actual.AttributeAssignmentExpressions, AssertAttributeAssignmentExpressionEqual); }
private static void WriteObligationExpression(XmlWriter writer, XacmlObligationExpression xacmlObligationExpression) { Guard.ArgumentNotNull(writer, nameof(writer)); Guard.ArgumentNotNull(xacmlObligationExpression, nameof(xacmlObligationExpression)); writer.WriteStartElement(XacmlConstants.Prefixes.Xacml, XacmlConstants.ElementNames.ObligationExpression, Xacml30Constants.NameSpaces.Policy); writer.WriteAttributeString(XacmlConstants.AttributeNames.ObligationId, xacmlObligationExpression.ObligationId.OriginalString); writer.WriteAttributeString(XacmlConstants.AttributeNames.FulfillOn, xacmlObligationExpression.FulfillOn.ToString()); foreach (XacmlAttributeAssignmentExpression attributeAssigmentExpression in xacmlObligationExpression.AttributeAssignmentExpressions) { WriteAttributeAssignmentExpression(writer, attributeAssigmentExpression); } writer.WriteEndElement(); }