Beispiel #1
0
        public void CannotAddRootActionIfCaptureIsOff()
        {
            // given
            var configuration = new TestConfiguration();

            configuration.DisableCapture();

            var target = new Beacon(logger, new BeaconCache(),
                                    configuration, "127.0.0.1", threadIdProvider, timingProvider);

            // when adding the root action
            const string RootActionName = "TestRootAction";

            target.AddAction(new RootAction(logger, target, RootActionName, new SynchronizedQueue <IAction>()));

            // then
            Assert.That(target.ActionDataList, Is.Empty);
        }
Beispiel #2
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);
        }