Esempio n. 1
0
        public void MetaGet_Ok2()
        {
            using var area = new TestArea("metaGetOkTest");
            DroneDB.Init(area.TestFolder);

            DroneDB.MetaAdd(area.TestFolder, "tests", "{\"test\":true}");
            DroneDB.MetaAdd(area.TestFolder, "tests", "{\"test\":false}");
            DroneDB.MetaAdd(area.TestFolder, "tests", "{\"test\":null}");

            var res = JsonConvert.DeserializeObject <Meta[]>(DroneDB.MetaGet(area.TestFolder, "tests"));

            res.Should().HaveCount(3);
        }
Esempio n. 2
0
        public void MetaGet_Ok()
        {
            using var area = new TestArea("metaGetOkTest");
            DroneDB.Init(area.TestFolder);

            DroneDB.MetaSet(area.TestFolder, "abc", "true");

            FluentActions.Invoking(() => DroneDB.MetaGet(area.TestFolder, "nonexistant")).Should()
            .Throw <DDBException>();

            FluentActions.Invoking(() => DroneDB.MetaGet(area.TestFolder, "abc", "123")).Should()
            .Throw <DDBException>();

            JsonConvert.DeserializeObject <Meta>(DroneDB.MetaGet(area.TestFolder, "abc")).Data
            .Should().Be(true);
        }