Пример #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));
        }
Пример #2
0
        public void ByElevation_ShouldProduceLevelAtCorrectElevation()
        {
            var elevation = 100.0;
            var level     = Level.ByElevation(elevation);

            Assert.NotNull(level);

            level.Elevation.ShouldBeApproximately(elevation);
            level.ProjectElevation.ShouldBeApproximately(elevation);

            // without unit conversion
            InternalElevation(level)
            .ShouldBeApproximately(elevation * UnitConverter.DynamoToHostFactor(UnitType.UT_Length));
        }
Пример #3
0
        public void ByLevelAndOffset_ValidArgs()
        {
            var elevation = 100.0;
            var offset    = 100.0;
            var level     = Level.ByElevation(elevation);

            var level2 = Level.ByLevelAndOffset(level, offset);

            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));
        }
Пример #4
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));
        }