Beispiel #1
0
        public void Process_AmountOfEventsNotSatisfyRequiredCondition_ReturnNotApplicableFact()
        {
            // arrange
            _settings = new ItHappenedSettings(
                null,
                null,
                new NEventsRecordedFactSettings(3));

            var nEventsRecordedFact = new NEventsRecordedFact(_settings);

            // act
            nEventsRecordedFact.Process(events, trackName);

            // assert
            Assert.IsFalse(nEventsRecordedFact.IsApplicable);
        }
Beispiel #2
0
        public void Process_ReturnApplicableFactForCorrectData()
        {
            // arrange
            _settings = new ItHappenedSettings(
                null,
                null,
                new NEventsRecordedFactSettings(2));

            var nEventsRecordedFact = new NEventsRecordedFact(_settings);

            // act
            nEventsRecordedFact.Process(events, trackName);

            // assert
            Assert.IsTrue(nEventsRecordedFact.IsApplicable);
            Assert.AreEqual(Math.Log(3), nEventsRecordedFact.Priority);
            Assert.AreEqual(
                $"У вас произошло уже 3 события!",
                nEventsRecordedFact.Description);
        }