private static TestProfiler SetupTestProfiler(bool useNullTransport)
        {
            var testProfiler = new TestProfiler();

            testProfiler.Initialize(useNullTransport);
            return(testProfiler);
        }
        public void TestSentNoData()
        {
            const bool   useNullTransport = true;
            TestProfiler testProfiler     = SetupTestProfiler(useNullTransport);

            TestProfiler.ProfilerBeginTick();
            TestProfiler.NotifyProfilerListeners();

            Assert.False(testProfiler.HasSentAnyData);
        }
        public void TestNormalRegisterAndNotifyFlow()
        {
            const bool   useNullTransport = false;
            TestProfiler testProfiler     = SetupTestProfiler(useNullTransport);

            RegisterStaticAsserts(useNullTransport);

            TestProfiler.ProfilerBeginTick();
            testProfiler.Send();
            TestProfiler.NotifyProfilerListeners();

            Assert.IsTrue(testProfiler.HasSentAnyData);
        }
        public void TestDroppedRegisterAndNotifyFlow()
        {
            const bool   useNullTransport = false;
            TestProfiler testProfiler     = SetupTestProfiler(useNullTransport);

            RegisterStaticAsserts(useNullTransport);

            TestProfiler.ProfilerBeginTick();
            testProfiler.Send();
            TestProfiler.NotifyProfilerListeners();

            // Capturing data after notifying listeners is bad
            Assert.Catch <NoTickDataException>(() =>
            {
                testProfiler.Send();
            });

            Assert.IsTrue(testProfiler.HasSentAnyData);
        }