public void IVL_ContainsTest05()
        {
            // Create an instance of IVL
            IVL <PQ> acceptableRange = new IVL <PQ>(
                new PQ(0, "L"),
                new PQ(10, "L")
                )
            {
                LowClosed  = true,
                HighClosed = true
            };

            // Since we need to convert PQ units, add a unit converter
            PQ.UnitConverters.Add(new SimpleSiUnitConverter());
            PQ test = new PQ(10, "m");

            try
            {
                // Determine if the value is in range (true)
                bool isInRange = acceptableRange.Contains(test);
                acceptableRange.NullFlavor = NullFlavor.NoInformation;
                Assert.IsFalse(isInRange);
            }
            catch (Exception e)
            {
                Assert.IsTrue(e.ToString().Contains("Units must match to compare PQ"));
            }
        }
Exemple #2
0
        public void IVLTSNotContainsWidthTest()
        {
            // Create an IVL starting on 20000101
            IVL <TS> container = new IVL <TS>(DateTime.Parse("2000-01-01"), null);

            container.Width = new PQ(1, "a");
            Assert.IsFalse(container.Contains(DateTime.Parse("2002-05-22")));
        }
Exemple #3
0
        public void IVLPQNotContainsTest()
        {
            IVL <PQ> ageRange = new IVL <PQ>(
                new PQ(1, "a"),
                new PQ(3, "a")
                );

            Assert.IsTrue(ageRange.Contains(new PQ(24, "mo")));
        }
Exemple #4
0
 public void IVLINTNotContainsExceptionTest()
 {
     IVL<INT> container = new IVL<INT>(1, null);
     container.Width = new PQ(1, "ft");
     try
     {
         container.Contains(9);
         Assert.IsTrue(false);
     }
     catch (InvalidOperationException)
     {
         Assert.IsTrue(true);
     }
     catch (Exception)
     {
         Assert.IsTrue(false);
     }
 }
Exemple #5
0
        public void IVLINTNotContainsExceptionTest()
        {
            IVL <INT> container = new IVL <INT>(1, null);

            container.Width = new PQ(1, "ft");
            try
            {
                container.Contains(9);
                Assert.IsTrue(false);
            }
            catch (InvalidOperationException)
            {
                Assert.IsTrue(true);
            }
            catch (Exception)
            {
                Assert.IsTrue(false);
            }
        }
        public void IVL_ContainsTest01()
        {
            // Create an instance of IVL
            IVL <PQ> acceptableRange = new IVL <PQ>(
                new PQ(0, "L"),
                new PQ(10, "L")
                )
            {
                LowClosed  = true,
                HighClosed = true
            };

            // Since we need to convert PQ units, add a unit converter
            PQ.UnitConverters.Add(new SimpleSiUnitConverter());
            PQ test = new PQ(9, "L");

            // Determine if the value is in range (true)
            bool isInRange = acceptableRange.Contains(test);

            acceptableRange.NullFlavor = NullFlavor.NoInformation;
            Assert.IsTrue(isInRange);
        }
Exemple #7
0
        public void IVLINTNotContainsTest()
        {
            IVL <INT> container = new IVL <INT>(1, 10);

            Assert.IsFalse(container.Contains(90));
        }
Exemple #8
0
        public void IVLINTContainsTest()
        {
            IVL <INT> container = new IVL <INT>(1, 10);

            Assert.IsTrue(container.Contains(9));
        }
Exemple #9
0
        public void IVLTSNotContainsTest()
        {
            IVL <TS> container = new IVL <TS>(DateTime.MinValue, DateTime.Now);

            Assert.IsFalse(container.Contains(DateTime.MaxValue));
        }
Exemple #10
0
 public void IVLINTNotContainsTest()
 {
     IVL<INT> container = new IVL<INT>(1, 10);
     Assert.IsFalse(container.Contains(90));
 }
Exemple #11
0
 public void IVLINTContainsTest()
 {
     IVL<INT> container = new IVL<INT>(1, 10);
     Assert.IsTrue(container.Contains(9));
 }
Exemple #12
0
 public void IVLTSNotContainsWidthTest()
 {
     // Create an IVL starting on 20000101
     IVL<TS> container = new IVL<TS>(DateTime.Parse("2000-01-01"), null);
     container.Width = new PQ(1, "a");
     Assert.IsFalse(container.Contains(DateTime.Parse("2002-05-22")));
 }
Exemple #13
0
 public void IVLTSNotContainsTest()
 {
     IVL<TS> container = new IVL<TS>(DateTime.MinValue, DateTime.Now);
     Assert.IsFalse(container.Contains(DateTime.MaxValue));
 }
Exemple #14
0
 public void IVLPQNotContainsTest()
 {
     IVL<PQ> ageRange = new IVL<PQ>(
         new PQ(1, "a"),
         new PQ(3, "a")
     );
     Assert.IsTrue(ageRange.Contains(new PQ(24,"mo")));
 }
Exemple #15
0
        public void IVL_ContainsTest01()
        {
            // Create an instance of IVL
            IVL<PQ> acceptableRange = new IVL<PQ>(
                new PQ(0, "L"),
                new PQ(10, "L")
            )
            {
                LowClosed = true,
                HighClosed = true
            };

            // Since we need to convert PQ units, add a unit converter
            PQ.UnitConverters.Add(new SimpleSiUnitConverter());
            PQ test = new PQ(9, "L");

            // Determine if the value is in range (true)
            bool isInRange = acceptableRange.Contains(test);

            acceptableRange.NullFlavor = NullFlavor.NoInformation;
            Assert.IsTrue(isInRange);
        }
Exemple #16
0
        public void IVL_ContainsTest05()
        {
            // Create an instance of IVL
            IVL<PQ> acceptableRange = new IVL<PQ>(
                new PQ(0, "L"),
                new PQ(10, "L")
            )
            {
                LowClosed = true,
                HighClosed = true
            };

            // Since we need to convert PQ units, add a unit converter
            PQ.UnitConverters.Add(new SimpleSiUnitConverter());
            PQ test = new PQ(10, "m");

            try
            {
                // Determine if the value is in range (true)
                bool isInRange = acceptableRange.Contains(test);
                acceptableRange.NullFlavor = NullFlavor.NoInformation;
                Assert.IsFalse(isInRange);
            }
            catch (Exception e)
            {
                Assert.IsTrue(e.ToString().Contains("Units must match to compare PQ"));
            }
        }