Beispiel #1
0
        public void HandlesEmptyValue()
        {
            var masker = new ValueSecret(null);
            var input = "abcdefg";

            var positions = masker.GetPositions(input);
            Assert.Equal(0, positions.Count());
        }
Beispiel #2
0
        public void HandlesEmptyInput()
        {
            var masker = new ValueSecret("def");
            string input = null;

            var positions = masker.GetPositions(input);
            Assert.Equal(0, positions.Count());
        }
Beispiel #3
0
        public void HandlesEmptyInput()
        {
            var    masker = new ValueSecret("def");
            string input  = null;

            var positions = masker.GetPositions(input);

            Assert.Equal(0, positions.Count());
        }
Beispiel #4
0
        public void HandlesEmptyValue()
        {
            var masker = new ValueSecret(null);
            var input  = "abcdefg";

            var positions = masker.GetPositions(input);

            Assert.Equal(0, positions.Count());
        }
Beispiel #5
0
        public void GetPositionFromEndOfString()
        {
            var masker = new ValueSecret("efg");
            string input = "abcdefg";

            var positions = masker.GetPositions(input).ToList();
            Assert.Equal(1, positions.Count);
            Assert.Equal(4, positions[0].Start);
            Assert.Equal(3, positions[0].Length);
        }
Beispiel #6
0
        public void GetPositionFromEndOfString()
        {
            var    masker = new ValueSecret("efg");
            string input  = "abcdefg";

            var positions = masker.GetPositions(input).ToList();

            Assert.Equal(1, positions.Count);
            Assert.Equal(4, positions[0].Start);
            Assert.Equal(3, positions[0].Length);
        }
Beispiel #7
0
        public void GetsMultiplePositions()
        {
            var masker = new ValueSecret("def");
            string input = "abcdefgdefg";

            var positions = masker.GetPositions(input).ToList();
            Assert.Equal(2, positions.Count);
            Assert.Equal(3, positions[0].Start);
            Assert.Equal(3, positions[0].Length);
            Assert.Equal(7, positions[1].Start);
            Assert.Equal(3, positions[1].Length);
        }
Beispiel #8
0
        public void GetsOverlappingPositions()
        {
            var    masker = new ValueSecret("cdcd");
            string input  = "abcdcdcdefg";

            var positions = masker.GetPositions(input).ToList();

            Assert.Equal(2, positions.Count);
            Assert.Equal(2, positions[0].Start);
            Assert.Equal(4, positions[0].Length);
            Assert.Equal(4, positions[1].Start);
            Assert.Equal(4, positions[1].Length);
        }
Beispiel #9
0
        public void GetsMultiplePositions()
        {
            var    masker = new ValueSecret("def");
            string input  = "abcdefgdefg";

            var positions = masker.GetPositions(input).ToList();

            Assert.Equal(2, positions.Count);
            Assert.Equal(3, positions[0].Start);
            Assert.Equal(3, positions[0].Length);
            Assert.Equal(7, positions[1].Start);
            Assert.Equal(3, positions[1].Length);
        }
Beispiel #10
0
        public void GetsOverlappingPositions()
        {
            var masker = new ValueSecret("cdcd");
            string input = "abcdcdcdefg";

            var positions = masker.GetPositions(input).ToList();
            Assert.Equal(2, positions.Count);
            Assert.Equal(2, positions[0].Start);
            Assert.Equal(4, positions[0].Length);
            Assert.Equal(4, positions[1].Start);
            Assert.Equal(4, positions[1].Length);
        }