Exemple #1
0
        public void EvictRecordsByAge()
        {
            // given
            var target = new BeaconCache();

            target.AddActionData(1, 1000L, "a");
            target.AddActionData(1, 1001L, "iii");
            target.AddEventData(1, 1000L, "b");
            target.AddEventData(1, 1001L, "jjj");

            // when
            var obtained = target.EvictRecordsByAge(1, 1001);

            // then
            Assert.That(obtained, Is.EqualTo(2));
        }
Exemple #2
0
        public void EvictRecordsByAgeDoesNothingAndReturnsZeroIfBeaconIDDoesNotExist()
        {
            // given
            var target = new BeaconCache();

            target.AddActionData(1, 1000L, "a");
            target.AddActionData(1, 1001L, "iii");
            target.AddEventData(1, 1000L, "b");
            target.AddEventData(1, 1001L, "jjj");

            // when
            var obtained = target.EvictRecordsByAge(666, 0);

            // then
            Assert.That(obtained, Is.EqualTo(0));
        }