Esempio n. 1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or
        /// resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            m_Interval.Dispose();

            var report = m_Storage.ForInterval(m_Interval);

            m_Collection.Add(new ProfilingTimeReport(m_Interval.Description, m_Transformer(report)));
        }
        public void Add()
        {
            var report = new Mock <IProfilingTimeReport>();

            var collection = new TimingReportCollection();

            collection.CollectionChanged +=
                (s, e) =>
            {
                Assert.AreEqual(NotifyCollectionChangedAction.Add, e.Action);
                Assert.AreEqual(1, e.NewItems.Count);
                Assert.IsNull(e.OldItems);
                Assert.AreSame(report.Object, e.NewItems[0]);
            };

            collection.Add(report.Object);
            Assert.That(
                collection,
                Is.EquivalentTo(
                    new List <IProfilingTimeReport>
            {
                report.Object,
            }));
        }