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(); }
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(); }
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(); }
public SpyController(ISpyRepository repository, SpyDetector spyDetector, SpyService spyService) { _spyDetector = spyDetector; _repository = repository; _spyService = spyService; }