コード例 #1
0
        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);
        }
コード例 #2
0
        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();
        }