public void StringValueTest() { var value = _ionValueFactory.NewString("test"); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.String, reader.MoveNext()); Assert.AreEqual("test", reader.StringValue()); }
public void NullValueTest() { var value = _ionValueFactory.NewNull(); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.Null, reader.MoveNext()); Assert.IsTrue(reader.CurrentIsNull); }
public void SingleDoubleNumberTest() { var value = _ionValueFactory.NewFloat(123.456); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.Float, reader.MoveNext()); Assert.AreEqual(123.456, reader.DoubleValue()); }
public void NullParentHasNext() { var value = _ionValueFactory.NewInt(123); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.Int, reader.MoveNext()); Assert.IsFalse(reader.HasNext()); }
public void TimestampTest() { var timestamp = new Timestamp(DateTime.Now); var value = _ionValueFactory.NewTimestamp(timestamp); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.Timestamp, reader.MoveNext()); Assert.AreEqual(timestamp, reader.TimestampValue()); }
public void SingleDecimalNumberTest() { var decimalValue = new BigDecimal(decimal.MaxValue); var value = _ionValueFactory.NewDecimal(decimalValue); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.Decimal, reader.MoveNext()); Assert.AreEqual(decimalValue, reader.DecimalValue()); }
public void CurrentTypeTest() { var value = _ionValueFactory.NewBool(true); var reader = new UserTreeReader(value); Assert.AreEqual(IonType.None, reader.CurrentType); reader.MoveNext(); Assert.AreEqual(IonType.Bool, reader.CurrentType); }