Пример #1
0
        public async void Show()
        {
            MeilisearchDotnet.Types.IndexResponse res = await index.Show();

            Assert.Equal(Uid, res.Uid);
            Assert.Equal(Uid, res.Name);
            Assert.Equal(PrimaryKey, res.PrimaryKey);
        }
Пример #2
0
        public async void UpdateIndex()
        {
            string uid        = "orek";
            string primaryKey = "key1";
            await ms.CreateIndex(new MeilisearchDotnet.Types.IndexRequest {
                Uid = uid
            });

            MeilisearchDotnet.Types.IndexResponse res = await ms.UpdateIndex(uid, new MeilisearchDotnet.Types.UpdateIndexRequest
            {
                PrimaryKey = primaryKey
            });

            Assert.Equal(primaryKey, res.PrimaryKey);
            Assert.Equal(uid, res.Name);
            Assert.Equal(uid, res.Uid);
            await Assert.ThrowsAsync <MeilisearchDotnet.Exceptions.BadRequestException>(async() => await ms.UpdateIndex(uid, new MeilisearchDotnet.Types.UpdateIndexRequest
            {
                PrimaryKey = primaryKey
            }));

            await ms.DeleteIndex(uid);
        }