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

            var testingTarget = new Extents();

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <Extents>(testingTarget, "should be an instance of testing target class!");

            Assert.AreEqual(0, testingTarget.Top, "Should be equal!");

            using (Extents extents = new Extents(20, 20, 20, 20))
            {
                testingTarget.CopyFrom(extents);
                Assert.AreEqual(20, testingTarget.Top, "Should be equal!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"ExtentsCopyFrom END (OK)");
        }
Example #2
0
        public void ExtentsCopyFromNullExtents()
        {
            tlog.Debug(tag, $"ExtentsCopyFromNullExtents START");

            var testingTarget = new Extents();

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <Extents>(testingTarget, "should be an instance of testing target class!");

            Assert.AreEqual(0, testingTarget.Top, "Should be equal!");

            try
            {
                Extents extents = null;
                testingTarget.CopyFrom(extents);
            }
            catch (ArgumentNullException)
            {
                testingTarget.Dispose();
                tlog.Debug(tag, $"ExtentsCopyFromNullExtents END (OK)");
                Assert.Pass("Caught ArgumentNullException : Passed!");
            }
        }