示例#1
0
        public async Task FavRemoveFailDataTest()
        {
            using var store   = GetDocumentStore();
            using var session = store.OpenAsyncSession();

            var persist = new FavRemove {
                Session = session, Key = "user", Value = UserData.SecondId, CurrentUser = AdminUser
            };
            await persist.Execute();

            persist.Confirm.Should().NotBeNull();
            persist.Confirm.Success.Should().BeFalse();
        }
示例#2
0
        public async Task <IActionResult> Remove(string key, string value)
        {
            var persist = new FavRemove {
                CurrentUser = CurrentUser, Key = key, Value = value
            };
            await DataHandler.Execute(persist);

            if (persist.Confirm.Success)
            {
                await DataHandler.Commit();
            }

            return(Ok(false));
        }
示例#3
0
        public async Task FavRemoveExistingDataTest()
        {
            using var store   = GetDocumentStore();
            using var session = store.OpenAsyncSession();

            var persist = new FavRemove {
                Session = session, Key = "user", Value = UserData.FirstId, CurrentUser = StandardUser
            };
            await persist.Execute();

            persist.Confirm.Should().NotBeNull();
            persist.Confirm.Success.Should().BeTrue();
            persist.Model.EntityIds.Count.Should().Be(0);
        }