public void WriteBoolTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(true); Assert.Equal("True", tw.Text); tw.Clear(); tw.Write(false); Assert.Equal("False", tw.Text); } }
public void WriteLongTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(long.MinValue); Assert.Equal(long.MinValue.ToString(), tw.Text); tw.Clear(); tw.Write(long.MaxValue); Assert.Equal(long.MaxValue.ToString(), tw.Text); } }
public void WriteFloatTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(float.MinValue); Assert.Equal(float.MinValue.ToString(), tw.Text); tw.Clear(); tw.Write(float.MaxValue); Assert.Equal(float.MaxValue.ToString(), tw.Text); tw.Clear(); tw.Write(float.NaN); Assert.Equal(float.NaN.ToString(), tw.Text); } }
public void WriteCharArrayIndexCountTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(TestDataProvider.CharData, 3, 5); Assert.Equal(new string(TestDataProvider.CharData, 3, 5), tw.Text); } }
public void WriteStringMultipleObjectsTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(TestDataProvider.FormatStringMultipleObjects, TestDataProvider.MultipleObjects); Assert.Equal(string.Format(TestDataProvider.FormatStringMultipleObjects, TestDataProvider.MultipleObjects), tw.Text); } }
public void WriteStringThreeObjectsTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(TestDataProvider.FormatStringThreeObjects, TestDataProvider.FirstObject, TestDataProvider.SecondObject, TestDataProvider.ThirdObject); Assert.Equal(string.Format(TestDataProvider.FormatStringThreeObjects, TestDataProvider.FirstObject, TestDataProvider.SecondObject, TestDataProvider.ThirdObject), tw.Text); } }
public void WriteStringObjectTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(TestDataProvider.FormatStringOneObject, TestDataProvider.FirstObject); Assert.Equal(string.Format(TestDataProvider.FormatStringOneObject, TestDataProvider.FirstObject), tw.Text); } }
public void WriteObjectTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(TestDataProvider.FirstObject); Assert.Equal(TestDataProvider.FirstObject.ToString(), tw.Text); } }
public void WriteStringTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.Write(new string(TestDataProvider.CharData)); Assert.Equal(new string(TestDataProvider.CharData), tw.Text); } }
public void WriteCharSpanTest() { using (CharArrayTextWriter tw = NewTextWriter) { var rs = new ReadOnlySpan <char>(TestDataProvider.CharData, 4, 6); tw.Write(rs); Assert.Equal(new string(rs), tw.Text); } }
public void WriteCharTest() { using (CharArrayTextWriter tw = NewTextWriter) { for (int count = 0; count < TestDataProvider.CharData.Length; ++count) { tw.Write(TestDataProvider.CharData[count]); } Assert.Equal(new string(TestDataProvider.CharData), tw.Text); } }