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")); } }
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"))); }
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"))); }
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 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); }
public void IVLINTNotContainsTest() { IVL <INT> container = new IVL <INT>(1, 10); Assert.IsFalse(container.Contains(90)); }
public void IVLINTContainsTest() { IVL <INT> container = new IVL <INT>(1, 10); Assert.IsTrue(container.Contains(9)); }
public void IVLTSNotContainsTest() { IVL <TS> container = new IVL <TS>(DateTime.MinValue, DateTime.Now); Assert.IsFalse(container.Contains(DateTime.MaxValue)); }
public void IVLINTNotContainsTest() { IVL<INT> container = new IVL<INT>(1, 10); Assert.IsFalse(container.Contains(90)); }
public void IVLINTContainsTest() { IVL<INT> container = new IVL<INT>(1, 10); Assert.IsTrue(container.Contains(9)); }
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"))); }
public void IVLTSNotContainsTest() { IVL<TS> container = new IVL<TS>(DateTime.MinValue, DateTime.Now); Assert.IsFalse(container.Contains(DateTime.MaxValue)); }
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"))); }
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); }
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")); } }