Beispiel #1
0
        public void ClearDataClearsActionAndEventData()
        {
            // given
            var target = new Beacon(logger, new BeaconCache(), new TestConfiguration(), "127.0.0.1", threadIdProvider, timingProvider);
            var action = new Action(logger, target, "TestAction", new SynchronizedQueue <IAction>());

            action.ReportEvent("TestEvent").ReportValue("TheAnswerToLifeTheUniverseAndEverything", 42);
            target.AddAction(action);

            // then check data both lists are not empty
            Assert.That(target.ActionDataList, Is.Not.Empty);
            Assert.That(target.EventDataList, Is.Not.Empty);

            // and when clearing the data
            target.ClearData();

            // then check data both lists are emtpy
            Assert.That(target.ActionDataList, Is.Empty);
            Assert.That(target.EventDataList, Is.Empty);
        }