public void TestResultIsNotEmptyWhenUsernameNumberViolationExist()
        {
            var events             = TestsBase.GetEvents(@"Logs\singleUserName.xml");
            var validationProvider = TestsBase.CreateValidationProvider();

            var validationCollection     = validationProvider.Validate(events);
            var singleUserNameViolations = validationCollection.Select(v => v.Type == ViolationType.UserNameNumberAttempt);

            Assert.AreEqual(singleUserNameViolations.Count(), 1);
        }
        public void TestResultEmptyWhenNoViolations()
        {
            var events = TestsBase.GetEvents(@"Logs\noviolations.xml");
            var validationConfiguration = new ValidationConfiguration()
            {
                SameUsernameAttemptsPeriodLimit     = 1,
                MultipleUsernameAttemptsPeriodLimit = 1,
                UserNameAttemptsLimit = 1
            };

            var validationProvider   = new ValidationProvider(validationConfiguration);
            var validationCollection = validationProvider.Validate(events);

            Assert.IsEmpty(validationCollection);
        }
Exemplo n.º 3
0
 protected static List <Event> GetEvents(string logLocation)
 {
     return(TestsBase.GetReader(logLocation).ReadLogEvents());
 }