Esempio n. 1
0
        public void SnapshotOptions_Configure()
        {
            var sn = new StringBuilder()
                     .AppendLine("Line 1")
                     .AppendLine("Line 2")
                     .AppendLine("Line 3");

            var savedsnap = SnapshotTokenizer.Tokenize(sn.ToString());

            var config = new SnapshotOptions();

            config.SetComparer((newline, savedline) => newline.Value.Replace(" ", string.Empty, StringComparison.OrdinalIgnoreCase).Equals(savedline.Value.Replace(" ", string.Empty, StringComparison.OrdinalIgnoreCase)));

            sn = new StringBuilder()
                 .AppendLine("Line    1")
                 .AppendLine("   Line 2")
                 .AppendLine("  Line     3");

            var newsnap = SnapshotTokenizer.Tokenize(sn.ToString());

            var comparer = new SnapshotCompare();
            var result   = comparer.Compare(newsnap, savedsnap, config);

            result.Status.Should().Be(SnapshotStatus.SnapshotsMatch);

            SnapshotOptions.Setup(o => { });
        }