Exemple #1
0
        public void TimerDisposeWithDisposedInstance()
        {
            tlog.Debug(tag, $"TimerDisposeWithDisposedInstance START");

            var testingTarget = new MyTimer(100);

            Assert.IsNotNull(testingTarget, "Can't create success object Timer");
            Assert.IsInstanceOf <Timer>(testingTarget, "Should be an instance of Timer type.");

            testingTarget.OnDispose(DisposeTypes.Explicit);

            try
            {
                testingTarget.OnDispose(DisposeTypes.Explicit);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception: Failed!");
            }

            tlog.Debug(tag, $"TimerDisposeWithDisposedInstance END (OK)");
        }