Esempio n. 1
0
        public void TestMeasureUnitValueEquals()
        {
            const string error = "Invalid return from ValueEquals method";

            TestMeasureUnit mu = new TestMeasureUnit();

            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.MeasureUnitType = MeasureUnit.MeasureUnitTypeCode.Complex;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.MeasureUnitType = mu.MeasureUnitType;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.CalculationType = MeasureUnit.CalculationTypeCode.Multiply;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.CalculationType = mu.CalculationType;
            Assert.IsTrue(this.ValueEquals(mu), error);

            Measure m0 = new Measure();

            m0.Schema = "m0";
            Measure m1 = new Measure();

            m1.Schema = "m1";

            mu.Measure1 = m0;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure1 = m0;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.Measure2 = m1;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure2 = m1;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.Measure2 = null;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure2 = null;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.Measure1 = null;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure1 = null;
            Assert.IsTrue(this.ValueEquals(mu), error);
        }
Esempio n. 2
0
        public void TestMeasureUnitValueEquals()
        {
            const string error = "Invalid return from ValueEquals method";

            TestMeasureUnit mu = new TestMeasureUnit();

            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.MeasureUnitType = MeasureUnit.MeasureUnitTypeCode.Complex;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.MeasureUnitType = mu.MeasureUnitType;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.CalculationType = MeasureUnit.CalculationTypeCode.Multiply;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.CalculationType = mu.CalculationType;
            Assert.IsTrue(this.ValueEquals(mu), error);

            Measure m0 = new Measure();
            m0.Schema = "m0";
            Measure m1 = new Measure();
            m1.Schema = "m1";

            mu.Measure1 = m0;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure1 = m0;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.Measure2 = m1;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure2 = m1;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.Measure2 = null;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure2 = null;
            Assert.IsTrue(this.ValueEquals(mu), error);

            mu.Measure1 = null;
            Assert.IsFalse(this.ValueEquals(mu), error);
            this.Measure1 = null;
            Assert.IsTrue(this.ValueEquals(mu), error);
        }