コード例 #1
0
        public void CheckConstraint(Frame frame, int index, Dictionary<int, ConstraintAndDescription> indexConstraintForFrame)
        {
            AddConstrains(index, frame, indexConstraintForFrame);

            ConstraintAndDescription constrintAndDescription;
            if (indexConstraintForFrame.TryGetValue(index, out constrintAndDescription))
            {
                if (!constrintAndDescription.Matches(frame))
                {
                    throw new FormatException("violated constraint " + constrintAndDescription + " in frame " + frame.ToString());
                }
            }
            else
                throw new FormatException("rule error: there is no constraint for frame index " + index);
        }
コード例 #2
0
 public void TestToString()
 {
     Frame frame = new Frame(9,9,1);
     Assert.AreEqual("9 9 1 ",frame.ToString());
 }