コード例 #1
0
        public void TestSetGetXElement(string key, XElement value)
        {
            var sut = new CustomDataMap();

            sut.SetXElement(key, value);

            Check.That(XNode.DeepEquals(sut.GetXElement(key, null), value)).IsTrue();
        }
コード例 #2
0
        public void TestNullKeyNotAllowed()
        {
            var sut = new CustomDataMap();

            Check.ThatCode(() => sut.SetString(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.SetBool(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.SetLong(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.SetULong(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.SetXElement(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.GetString(null)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.GetBool(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.GetLong(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.GetULong(null, default)).Throws <ArgumentNullException>();
            Check.ThatCode(() => sut.GetXElement(null, default)).Throws <ArgumentNullException>();
        }