Beispiel #1
0
        public void GetHash_ComputesOverEntireObject()
        {
            _writer.WriteObjectStart("a");
            _writer.WriteNameValue("b", 0);
            _writer.WriteNameValue("c", "d");
            _writer.WriteNameArray("e", new[] { "f", "g" });
            _writer.WriteObjectEnd();

            const string expectedHash = "TGP0LarTsGYQ2bqAC8lWyRQR+JsKzsO0Y+h6w7mtTj6mBOLTy8Dr0ZypSgzwzD9xuddh2ceDT7fEXve5ohuNeQ==";
            var          actualHash   = _writer.GetHash();

            Assert.Equal(expectedHash, actualHash);
        }
        public void WriteNameValue_WithIntValue_WhenNameIsNull_Throws()
        {
            ArgumentNullException exception = Assert.Throws <ArgumentNullException>(
                () => _writer.WriteNameValue(name: null, value: 3));

            Assert.Equal("name", exception.ParamName);
        }