Esempio n. 1
0
        public void ByLevelOffsetAndName_NullArgument()
        {
            var elevation = 100;
            var offset    = 100;
            var name      = "Ham";
            var level     = Level.ByElevation(elevation);

            Assert.Throws(typeof(ArgumentNullException), () => Level.ByLevelOffsetAndName(null, offset, name));
            Assert.Throws(typeof(ArgumentNullException), () => Level.ByLevelOffsetAndName(level, offset, null));
        }
Esempio n. 2
0
        public void ByLevelOffsetAndName_ShouldProduceLevelAtCorrectElevation()
        {
            var elevation = 100;
            var offset    = 100;
            var name      = "TortoiseTime";
            var level     = Level.ByElevation(elevation);

            var level2 = Level.ByLevelOffsetAndName(level, offset, name);

            Assert.NotNull(level2);

            level2.Elevation.ShouldBeApproximately(elevation + offset);
            level2.ProjectElevation.ShouldBeApproximately(elevation + offset);

            // without unit conversion
            InternalElevation(level2)
            .ShouldBeApproximately((elevation + offset) * UnitConverter.DynamoToHostFactor(UnitType.UT_Length));
        }