Beispiel #1
0
        public void EvictRecordsByNumberDoesNothingAndReturnsZeroIfBeaconIDDoesNotExist()
        {
            // 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.EvictRecordsByNumber(666, 100);

            // then
            Assert.That(obtained, Is.EqualTo(0));
        }
Beispiel #2
0
        public void EvictRecordsByNumber()
        {
            // 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
            int obtained = target.EvictRecordsByNumber(1, 2);

            // then
            Assert.That(obtained, Is.EqualTo(2));
        }
Beispiel #3
0
        public void EvictRecordsByNumber()
        {
            // given
            var key = new BeaconKey(1, 0);

            var target = new BeaconCache(logger);

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

            // when
            var obtained = target.EvictRecordsByNumber(key, 2);

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