Пример #1
0
        public void IsEmptyGivesFalseIfBeaconDataSizeIsNotEqualToZero()
        {
            // given
            var target = new BeaconCache();

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

            // then
            Assert.That(target.IsEmpty(1), Is.False);
        }
Пример #2
0
        public void IsEmptyGivesTrueIfBeaconDoesNotContainActiveData()
        {
            // given
            var target = new BeaconCache();

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

            target.GetNextBeaconChunk(1, "prefix", 0, '&');

            // then
            Assert.That(target.IsEmpty(1), Is.True);
        }
Пример #3
0
        public void IsEmptyGivesTrueIfBeaconDoesNotExistInCache()
        {
            // 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");

            // then
            Assert.That(target.IsEmpty(666), Is.True);
        }
Пример #4
0
        public void IsEmptyGivesTrueIfBeaconDoesNotExistInCache()
        {
            // given
            var keyOne = new BeaconKey(1, 0);
            var keyTwo = new BeaconKey(666, 0);

            var target = new BeaconCache(logger);

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

            // then
            Assert.That(target.IsEmpty(keyTwo), Is.True);
        }
Пример #5
0
        public void IsEmptyGivesTrueIfBeaconDoesNotContainActiveData()
        {
            // given
            var key = new BeaconKey(1, 0);

            var target = new BeaconCache(logger);

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

            target.PrepareDataForSending(key);

            target.GetNextBeaconChunk(key, "prefix", 0, '&');

            // then
            Assert.That(target.IsEmpty(key), Is.True);
        }