Exemplo n.º 1
0
        /// <summary>
        ///     Compares the provided object with an inline snapshot.
        ///     Use when snapshots are simple and small.
        /// </summary>
        /// <param name="snapshot">The object to compare with the inline snapshot</param>
        /// <param name="expectedSnapshot">The inline snapshot to which the object is compared with</param>
        public static void ShouldMatchInlineSnapshot(this object snapshot, object expectedSnapshot)
        {
            var snapper = SnapperFactory.GetJsonInlineSnapper(expectedSnapshot);

            snapper.MatchSnapshot(snapshot);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Compares the provided object with the stored snapshot.
        /// </summary>
        /// <param name="snapshot">The object to compare with the stored snapshot</param>
        public static void ShouldMatchSnapshot(this object snapshot)
        {
            var snapper = SnapperFactory.GetJsonSnapper();

            snapper.MatchSnapshot(snapshot);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Compares the provided object with the stored child snapshot.
        ///     Takes in a unique child name, best used in theory tests.
        /// </summary>
        /// <param name="snapshot">The object to compare with the stored child snapshot</param>
        /// <param name="childSnapshotName">The name of the child snapshot name. Must be unique per test.</param>
        public static void ShouldMatchChildSnapshot(this object snapshot, string childSnapshotName)
        {
            var snapper = SnapperFactory.GetJsonSnapper();

            snapper.MatchSnapshot(snapshot, childSnapshotName);
        }