public void CreateWriter_throws_exception_for_null_stream() { // act var e = Assert.Throws <ArgumentNullException>(() => TagWriter.CreateWriter(NbtFormat.Xml, null)); Assert.Equal($"Value cannot be null.{Environment.NewLine}Parameter name: stream", e.Message); }
public void CreateWriter_returns_xml_writer() { // act var target = TagWriter.CreateWriter(NbtFormat.Xml, new MemoryStream()); // assert Assert.IsType <XmlTagWriter>(target); }
public void CreateWriter_returns_binary_writer() { // act var target = TagWriter.CreateWriter(NbtFormat.Binary, new MemoryStream()); // assert Assert.IsType <BinaryTagWriter>(target); }
public void CreateWriter_returns_xml_writer() { // arrange TagWriter target; // act target = TagWriter.CreateWriter(NbtFormat.Xml, new MemoryStream()); // assert Assert.IsInstanceOf <XmlTagWriter>(target); }
public void CreateWriter_returns_binary_writer() { // arrange TagWriter target; // act target = TagWriter.CreateWriter(NbtFormat.Binary, new MemoryStream()); // assert Assert.IsInstanceOf <BinaryTagWriter>(target); }
public void CreateWriter_throws_exception_for_unknown_type() { // act var e = Assert.Throws <ArgumentOutOfRangeException>( () => TagWriter.CreateWriter(NbtFormat.Unknown, new MemoryStream())); Assert.Equal($"Invalid format.{Environment.NewLine}" + $"Parameter name: format{Environment.NewLine}" + "Actual value was Unknown.", e.Message); }
public void CreateWriter_throws_exception_for_unknown_type() { // act TagWriter.CreateWriter(NbtFormat.Unknown, new MemoryStream()); }
public void CreateWriter_throws_exception_for_null_stream() { // act TagWriter.CreateWriter(NbtFormat.Xml, null); }