Пример #1
0
        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);
        }
Пример #2
0
        public void CreateWriter_returns_xml_writer()
        {
            // act
            var target = TagWriter.CreateWriter(NbtFormat.Xml, new MemoryStream());

            // assert
            Assert.IsType <XmlTagWriter>(target);
        }
Пример #3
0
        public void CreateWriter_returns_binary_writer()
        {
            // act
            var target = TagWriter.CreateWriter(NbtFormat.Binary, new MemoryStream());

            // assert
            Assert.IsType <BinaryTagWriter>(target);
        }
Пример #4
0
        public void CreateWriter_returns_xml_writer()
        {
            // arrange
            TagWriter target;

            // act
            target = TagWriter.CreateWriter(NbtFormat.Xml, new MemoryStream());

            // assert
            Assert.IsInstanceOf <XmlTagWriter>(target);
        }
Пример #5
0
        public void CreateWriter_returns_binary_writer()
        {
            // arrange
            TagWriter target;

            // act
            target = TagWriter.CreateWriter(NbtFormat.Binary, new MemoryStream());

            // assert
            Assert.IsInstanceOf <BinaryTagWriter>(target);
        }
Пример #6
0
        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);
        }
Пример #7
0
 public void CreateWriter_throws_exception_for_unknown_type()
 {
     // act
     TagWriter.CreateWriter(NbtFormat.Unknown, new MemoryStream());
 }
Пример #8
0
 public void CreateWriter_throws_exception_for_null_stream()
 {
     // act
     TagWriter.CreateWriter(NbtFormat.Xml, null);
 }