Example #1
0
        public void ShouldMatchExactConsecutiveSequenceTest()
        {
            // Message Code Name Spy Contains spy?
            // [1,2,4,0,0,7,5] [0,0,7] James Bond true
            var detector = new SpyDetector();

            //Execute test
            var result = detector.ContainsSpy(new[] { 1, 2, 4, 0, 0, 7, 5 }, new[] { 0, 0, 7 });

            // Verify test result
            result.Should().BeTrue();
        }
Example #2
0
        public void ShouldNotMatchNonConsecutiveSequenceTest()
        {
            // Message Code Name Spy Contains spy?
            // [1,2,0,7,4,4,0] [0,0,7] James Bond false
            var detector = new SpyDetector();

            //Execute test
            var result = detector.ContainsSpy(new[] { 1, 2, 0, 7, 4, 4, 0 }, new[] { 0, 0, 7 });

            // Verify test result
            result.Should().BeFalse();
        }
Example #3
0
        public void ShouldMatchConsecutiveSequenceWithDuplicateTest()
        {
            // Message Code Name Spy Contains spy?
            // [3,3,1,5,1,4,4] [3,1,4] Ethan Hunt true
            var detector = new SpyDetector();

            //Execute test
            var result = detector.ContainsSpy(new[] { 3, 3, 1, 5, 1, 4, 4 }, new[] { 3, 1, 4 });

            // Verify test result
            result.Should().BeTrue();
        }
Example #4
0
 public SpyController(ISpyRepository repository, SpyDetector spyDetector, SpyService spyService)
 {
     _spyDetector = spyDetector;
     _repository  = repository;
     _spyService  = spyService;
 }