Пример #1
0
        public void RegisterUser_OnSuccessfulRegistration_RaisesUserRegisteredEvent()
        {
            // act
            this.controller.Index(this.validModel);

            // assert
            WaitUtils.WaitOperationUntil(this.isUserRegisteredEventRaised, RegistrationEventsTests.EventRaisedTotalTimeout, null, RegistrationEventsTests.EventRaisedPollTimeout);
            Assert.IsTrue(this.eventRaised);
        }
Пример #2
0
        private void SearchWithWaitOperation(string searchIndexName, string searchedText, int expectedCount, int waitMilliseconds = 5000, int sleepTimeMilliseconds = 1000)
        {
            int actualResult = 0;

            WaitUtils.WaitOperationUntil(
                () =>
            {
                int result   = this.ServiceSearchHitCount(searchIndexName, searchedText);
                actualResult = result;
                return(result == expectedCount);
            },
                waitMilliseconds,
                () =>
            {
                Assert.Fail(string.Format("Searched text \"{0}\". Expected count: {1}. Actual: {2}", searchedText, expectedCount, actualResult));
            },
                sleepTimeMilliseconds);
        }