コード例 #1
0
        public void Load_should_throw_exception_for_null_stream()
        {
            // arrange
            var target = new NbtDocument();

            // act
            Assert.Throws <ArgumentNullException>(() => target.Load((Stream)null));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #4
0
        public void Load_should_throw_exception_for_null_filename()
        {
            // arrange
            NbtDocument target;

            target = new NbtDocument();

            // act
            target.Load((string)null);
        }
コード例 #5
0
        public void Load_should_throw_exception_for_null_stream()
        {
            // arrange
            NbtDocument target;

            target = new NbtDocument();

            // act
            target.Load((Stream)null);
        }
コード例 #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);
        }
コード例 #7
0
        public void Load_should_throw_exception_for_invalid_file()
        {
            // arrange
            NbtDocument target;
            string      fileName;

            fileName = this.BadFileName;

            target = new NbtDocument();

            // act
            target.Load(fileName);
        }
コード例 #8
0
        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);
        }
コード例 #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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }
コード例 #12
0
    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);
    }
コード例 #13
0
    public void Load_should_throw_exception_for_null_stream()
    {
      // arrange
      NbtDocument target;

      target = new NbtDocument();

      // act
      target.Load((Stream)null);
    }
コード例 #14
0
    public void Load_should_throw_exception_for_null_filename()
    {
      // arrange
      NbtDocument target;

      target = new NbtDocument();

      // act
      target.Load((string)null);
    }
コード例 #15
0
    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);
    }
コード例 #16
0
    public void Load_should_throw_exception_for_invalid_file()
    {
      // arrange
      NbtDocument target;
      string fileName;

      fileName = this.BadFileName;

      target = new NbtDocument();

      // act
      target.Load(fileName);
    }