コード例 #1
0
        public void LeavingAnActionRemovesItselfFromListPassedInCtor()
        {
            // given
            var actions = new SynchronizedQueue <IAction>();
            var target  = new Action(logger, beacon, "test", actions);

            // when leaving the action
            target.LeaveAction();

            // then
            Assert.That(actions.IsEmpty, Is.True);
        }
コード例 #2
0
ファイル: Action.cs プロジェクト: alexlagler/openkit-dotnet
        internal Action(Beacon beacon, string name, Action parentAction, SynchronizedQueue <IAction> thisLevelActions)
        {
            this.beacon       = beacon;
            this.parentAction = parentAction;

            this.startTime       = beacon.CurrentTimestamp;
            this.startSequenceNo = beacon.NextSequenceNumber;
            this.id   = beacon.NextID;
            this.name = name;

            this.thisLevelActions = thisLevelActions;
            this.thisLevelActions.Put(this);
        }
コード例 #3
0
        public void AnActionAddsItselfIntoListInContstructor()
        {
            // given
            var actions = new SynchronizedQueue <IAction>();

            // when constructing the action
            var target = new Action(logger, beacon, "test", actions);

            // then
            Assert.That(actions.IsEmpty, Is.False);
            Assert.That(actions.ToList(), Is.EqualTo(new List <Action> {
                target
            }));
        }
コード例 #4
0
        public void DisposingAnActionLeavesTheAction()
        {
            // given
            var actions = new SynchronizedQueue <IAction>();

            mockTimingProvider.ProvideTimestampInMilliseconds().Returns(123L, 321L, 322L, 323L);
            IDisposable target = new Action(logger, beacon, "test", actions);

            while (beacon.NextSequenceNumber < 41)
            {
                ;                                    // increase the sequence number
            }
            // when disposing the target
            target.Dispose();

            // then
            Assert.That(actions.IsEmpty, Is.True);
            Assert.That(((Action)target).EndSequenceNo, Is.EqualTo(42));
            Assert.That(((Action)target).EndTime, Is.EqualTo(322L));
        }
コード例 #5
0
        // *** constructors ***

        public RootAction(ILogger logger, Beacon beacon, string name, SynchronizedQueue <IAction> thisLevelActions)
            : base(logger, beacon, name, thisLevelActions)
        {
            this.beacon = beacon;
        }
コード例 #6
0
ファイル: Action.cs プロジェクト: H3NM4R/openkit-dotnet
 public Action(ILogger logger, Beacon beacon, string name, SynchronizedQueue <IAction> thisLevelActions) : this(logger, beacon, name, null, thisLevelActions)
 {
 }
コード例 #7
0
ファイル: Action.cs プロジェクト: alexlagler/openkit-dotnet
        // *** constructors ***

        public Action(Beacon beacon, string name, SynchronizedQueue <IAction> parentActions) : this(beacon, name, null, parentActions)
        {
        }
コード例 #8
0
 public Action(Beacon beacon, string name, SynchronizedQueue <IAction> thisLevelActions) : this(beacon, name, null, thisLevelActions)
 {
 }