public void MetaList_Ok() { using var area = new TestArea("metaListOkTest"); DroneDB.Init(area.TestFolder); DroneDB.MetaAdd(area.TestFolder, "annotations", "123"); DroneDB.MetaAdd(area.TestFolder, "examples", "abc"); DroneDB.MetaList(area.TestFolder).Should().HaveCount(2); }
public void MetaAdd_Ok() { using var area = new TestArea("metaAddOkTest"); DroneDB.Init(area.TestFolder); FluentActions.Invoking(() => DroneDB.MetaAdd(area.TestFolder, "test", "123")).Should() .Throw <DDBException>(); // Needs plural key // DroneDB.MetaAdd("metaAddTest", "", "tests", "123").Data.ToObject<int>().Should().Be(123); }
public void MetaAdd_Json() { using var area = new TestArea("metaAddJsonTest"); DroneDB.Init(area.TestFolder); var res = DroneDB.MetaAdd(area.TestFolder, "tests", "{\"test\": true}"); JsonConvert.SerializeObject(res.Data).Should().Be("{\"test\":true}"); res.Id.Should().NotBeNull(); res.ModifiedTime.Should().BeCloseTo(DateTime.UtcNow, new TimeSpan(0, 0, 1)); }
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); }