Example #1
0
        public void TestBridgeUnits2()
        {
            UnitOfMeasure bridge1 = sys.CreateScalarUOM(UnitType.UNCLASSIFIED, "Bridge1", "B1", "description");
            UnitOfMeasure bridge2 = sys.CreateScalarUOM(UnitType.UNCLASSIFIED, "Bridge2", "B2", "description");

            bridge1.SetBridgeConversion(1, bridge2, 0);
            Assert.IsTrue(bridge1.BridgeScalingFactor.Equals(1));
            Assert.IsTrue(bridge1.BridgeAbscissaUnit.Equals(bridge2));
            Assert.IsTrue(bridge1.BridgeOffset.Equals(0));

            try
            {
                bridge1.SetConversion(10, bridge1, 0);
                Assert.Fail();
            }
            catch (Exception)
            {
            }

            try
            {
                bridge1.SetConversion(1, bridge1, 10);
                Assert.Fail();
            }
            catch (Exception)
            {
            }
        }