コード例 #1
0
        private SnapResult MatchSnapshot(object actual)
        {
            var snapper = NUnitSnapperFactory.GetNUnitSnapper();

            return(_childSnapshotName == null
                   ? snapper.MatchSnapshot(actual)
                   : snapper.MatchChildSnapshot(actual, _childSnapshotName));
        }
コード例 #2
0
        public override ConstraintResult ApplyTo <TActual>(TActual actual)
        {
            SnapResult snapResult;

            if (_snapshotId != null)
            {
                var snapper = NUnitSnapperFactory.GetNUnitSnapper();
                snapResult = snapper.MatchSnapshot(actual, _snapshotId);
            }
            else
            {
                snapResult = MatchSnapshot(actual);
            }

            return(new NUnitConstraintResult(this, actual, snapResult));
        }