public void WriteLineBoolTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(true); Assert.Equal("True" + tw.NewLine, tw.Text); tw.Clear(); tw.WriteLine(false); Assert.Equal("False" + tw.NewLine, tw.Text); } }
public void WriteLineDecimalTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(decimal.MinValue); Assert.Equal(decimal.MinValue.ToString() + tw.NewLine, tw.Text); tw.Clear(); tw.WriteLine(decimal.MaxValue); Assert.Equal(decimal.MaxValue.ToString() + tw.NewLine, tw.Text); } }
public void WriteLineFloatTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(float.MinValue); Assert.Equal(float.MinValue.ToString() + tw.NewLine, tw.Text); tw.Clear(); tw.WriteLine(float.MaxValue); Assert.Equal(float.MaxValue.ToString() + tw.NewLine, tw.Text); tw.Clear(); tw.WriteLine(float.NaN); Assert.Equal(float.NaN.ToString() + tw.NewLine, tw.Text); } }
public void WriteLineStringMultipleObjectsTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(TestDataProvider.FormatStringMultipleObjects, TestDataProvider.MultipleObjects); Assert.Equal(string.Format(TestDataProvider.FormatStringMultipleObjects + tw.NewLine, TestDataProvider.MultipleObjects), tw.Text); } }
public void WriteLineStringThreeObjectsTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(TestDataProvider.FormatStringThreeObjects, TestDataProvider.FirstObject, TestDataProvider.SecondObject, TestDataProvider.ThirdObject); Assert.Equal(string.Format(TestDataProvider.FormatStringThreeObjects + tw.NewLine, TestDataProvider.FirstObject, TestDataProvider.SecondObject, TestDataProvider.ThirdObject), tw.Text); } }
public void WriteLineStringObjectTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(TestDataProvider.FormatStringOneObject, TestDataProvider.FirstObject); Assert.Equal(string.Format(TestDataProvider.FormatStringOneObject + tw.NewLine, TestDataProvider.FirstObject), tw.Text); } }
public void WriteLineObjectTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(TestDataProvider.FirstObject); Assert.Equal(TestDataProvider.FirstObject.ToString() + tw.NewLine, tw.Text); } }
public void WriteLineStringTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(new string(TestDataProvider.CharData)); Assert.Equal(new string(TestDataProvider.CharData) + tw.NewLine, tw.Text); } }
public void WriteLineCharArrayIndexCountTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(TestDataProvider.CharData, 3, 5); Assert.Equal(new string(TestDataProvider.CharData, 3, 5) + tw.NewLine, tw.Text); } }
public void WriteLineTest() { using (CharArrayTextWriter tw = NewTextWriter) { tw.WriteLine(); Assert.Equal(tw.NewLine, tw.Text); } }
public void WriteLineCharSpanTest() { using (CharArrayTextWriter tw = NewTextWriter) { var rs = new ReadOnlySpan <char>(TestDataProvider.CharData, 4, 6); tw.WriteLine(rs); Assert.Equal(new string(rs) + tw.NewLine, tw.Text); } }
public void WriteLineCharTest() { using (CharArrayTextWriter tw = NewTextWriter) { for (int count = 0; count < TestDataProvider.CharData.Length; ++count) { tw.WriteLine(TestDataProvider.CharData[count]); } Assert.Equal(string.Join(tw.NewLine, TestDataProvider.CharData.Select(ch => ch.ToString()).ToArray()) + tw.NewLine, tw.Text); } }