ToString() public method

public ToString ( ) : string
return string
Ejemplo n.º 1
0
		public void Ctor ()
		{
			var v = new RangeItemHeaderValue (1, null);
			Assert.AreEqual ("1-", v.ToString (), "#1");

			v = new RangeItemHeaderValue (null, 1);
			Assert.AreEqual ("-1", v.ToString (), "#2");
		}
Ejemplo n.º 2
0
        public void ToString_UseDifferentRangeItems_AllSerializedCorrectly()
        {
            // Make sure ToString() doesn't add any separators.
            RangeItemHeaderValue rangeItem = new RangeItemHeaderValue(1000000000, 2000000000);
            Assert.Equal("1000000000-2000000000", rangeItem.ToString());

            rangeItem = new RangeItemHeaderValue(5, null);
            Assert.Equal("5-", rangeItem.ToString());

            rangeItem = new RangeItemHeaderValue(null, 10);
            Assert.Equal("-10", rangeItem.ToString());
        }