public void GivenListAndItemPresent_WhenDeletingItem_ShouldDeleteItem()
        {
            var service = CreateService();
            var list = new SeznamList("Id", "Name", false);
            var item = list.AddItem("item", 2);
            using (var session = DocumentStore.OpenSession())
            {
                session.Store(list);
                session.SaveChanges();
            }

            service.DeleteItem(list.Id, item.Name);

            using (var session = DocumentStore.OpenSession())
            {
                var l = session.Load<SeznamList>(list.Id);
                Assert.That(l.Items.Any(i => i.Name == item.Name), Is.False);
            }
        }
        public void GivenIsSharedWith_WhenGettingSummary_ShouldReturnSharedList()
        {
            var service = CreateService();
            var list = new SeznamList("User1", "Name", true, "User2");
            list.AddItem("item", 2);
            using (var session = DocumentStore.OpenSession())
            {
                session.Store(list);
                session.SaveChanges();
            }

            var summary = service.GetSummary("User2");

            Assert.That(summary, Is.Not.Null);
            Assert.That(summary.SharedLists, Contains.Item(list));
        }
        public void GivenListAndItemPresent_WhenTogglingItem_ShouldToggleItem()
        {
            var service = CreateService();
            var list = new SeznamList("Id", "Name", true);
            var item = list.AddItem("Name", 0);
            using (var session = DocumentStore.OpenSession())
            {
                session.Store(list);
                session.SaveChanges();
            }

            var toggleData = service.TogglePersonalItem(list.Id, item.Name, true);

            Assert.That(toggleData.Item.Completed, Is.Not.EqualTo(item.Completed));
        }