Exemple #1
0
        public void EventDataSet_HasRefcountAfterFrame_ReturnsTrueOnTrivialCase()
        {
            EventDataSet testSet = new EventDataSet();

            //Add sample to the refcount stream
            testSet.AddSample((int)ResourceManager.DiagnosticEventType.AsyncOperationReferenceCount, 5, 1);
            Assert.AreEqual(true, testSet.HasRefcountAfterFrame(0, true), "Refcount after frame was considered 0 when sample should have been added.");
        }
Exemple #2
0
        public void EventDataSet_HasRefcountAfterFrame_ReturnsTrueOnChildCase()
        {
            EventDataSet testSet = new EventDataSet();

            testSet.AddSample((int)ResourceManager.DiagnosticEventType.AsyncOperationReferenceCount, 2, 1);
            testSet.AddSample((int)ResourceManager.DiagnosticEventType.AsyncOperationReferenceCount, 4, 0);

            EventDataSet childSet = new EventDataSet();

            childSet.AddSample((int)ResourceManager.DiagnosticEventType.AsyncOperationReferenceCount, 5, 1);

            testSet.AddChild(childSet);

            Assert.AreEqual(true, testSet.HasRefcountAfterFrame(3, true), "Child refcount not properly considered when checking parent's refcount.");
        }