Example #1
0
        public void Load_should_throw_exception_for_null_stream()
        {
            // arrange
            var target = new NbtDocument();

            // act
            Assert.Throws <ArgumentNullException>(() => target.Load((Stream)null));
        }
Example #2
0
        public void Load_should_throw_exception_for_invalid_file()
        {
            // arrange
            var fileName = BadFileName;

            var target = new NbtDocument();

            // act
            Assert.Throws <InvalidDataException>(() => target.Load(fileName));
        }
Example #3
0
        public void Load_should_throw_exception_for_missing_file()
        {
            // arrange
            var fileName = Guid.NewGuid().ToString("N");

            var target = new NbtDocument();

            // act
            Assert.Throws <FileNotFoundException>(() => target.Load(fileName));
        }
        public void Load_should_throw_exception_for_null_filename()
        {
            // arrange
            NbtDocument target;

            target = new NbtDocument();

            // act
            target.Load((string)null);
        }
        public void Load_should_throw_exception_for_null_stream()
        {
            // arrange
            NbtDocument target;

            target = new NbtDocument();

            // act
            target.Load((Stream)null);
        }
Example #6
0
        public void LoadWithFileTest()
        {
            // arrange
            var fileName = ComplexDataFileName;
            var expected = new NbtDocument(CreateComplexData());
            var target   = new NbtDocument();

            // act
            target.Load(fileName);

            // assert
            NbtAssert.Equal(expected, target);
        }
        public void Load_should_throw_exception_for_invalid_file()
        {
            // arrange
            NbtDocument target;
            string      fileName;

            fileName = this.BadFileName;

            target = new NbtDocument();

            // act
            target.Load(fileName);
        }
        public void Load_should_throw_exception_for_missing_file()
        {
            // arrange
            NbtDocument target;
            string      fileName;

            fileName = Guid.NewGuid().ToString("N");

            target = new NbtDocument();

            // act
            target.Load(fileName);
        }
Example #9
0
        public void Load_updates_filename_property()
        {
            // arrange
            var expected = ComplexDataFileName;

            var target = new NbtDocument();

            // act
            target.Load(expected);

            // assert
            var actual = target.FileName;

            Assert.Equal(expected, actual);
        }
        public void LoadWithFileTest()
        {
            // arrange
            NbtDocument expected;
            NbtDocument target;
            string      fileName;

            fileName = this.ComplexDataFileName;
            expected = new NbtDocument(this.CreateComplexData());
            target   = new NbtDocument();

            // act
            target.Load(fileName);

            // assert
            NbtAssert.AreEqual(expected, target);
        }
        public void Load_updates_filename_property()
        {
            // arrange
            NbtDocument target;
            string      expected;
            string      actual;

            expected = this.ComplexDataFileName;

            target = new NbtDocument();

            // act
            target.Load(expected);

            // assert
            actual = target.FileName;
            Assert.AreEqual(expected, actual);
        }
    public void LoadWithFileTest()
    {
      // arrange
      NbtDocument target1;
      NbtDocument target2;
      string fileName;

      fileName = this.ComplexDataFileName;
      target1 = new NbtDocument(this.CreateComplexData());
      target2 = new NbtDocument();

      // act
      target2.Load(fileName);

      // assert
      this.CompareTags(target1.DocumentRoot, target2.DocumentRoot);
    }
    public void Load_should_throw_exception_for_null_stream()
    {
      // arrange
      NbtDocument target;

      target = new NbtDocument();

      // act
      target.Load((Stream)null);
    }
    public void Load_should_throw_exception_for_null_filename()
    {
      // arrange
      NbtDocument target;

      target = new NbtDocument();

      // act
      target.Load((string)null);
    }
    public void Load_should_throw_exception_for_missing_file()
    {
      // arrange
      NbtDocument target;
      string fileName;

      fileName = Guid.NewGuid().
                      ToString("N");

      target = new NbtDocument();

      // act
      target.Load(fileName);
    }
    public void Load_should_throw_exception_for_invalid_file()
    {
      // arrange
      NbtDocument target;
      string fileName;

      fileName = this.BadFileName;

      target = new NbtDocument();

      // act
      target.Load(fileName);
    }