Пример #1
0
        public void TestMutableDictSetJsonWithInvalidParam()
        {
            var md = new MutableDictionaryObject();
            // with random string
            Action badAction = (() => md.SetJSON("random string"));

            badAction.Should().Throw <CouchbaseLiteException>(CouchbaseLiteErrorMessage.InvalidJSON);

            //with array json string
            string[] arr  = { "apple", "banana", "orange" };
            var      jarr = JsonConvert.SerializeObject(arr);

            badAction = (() => md.SetJSON(jarr));
            badAction.Should().Throw <CouchbaseLiteException>(CouchbaseLiteErrorMessage.InvalidJSON);
        }