Esempio n. 1
0
        public void DeleteContent_ShouldDelete()
        {
            bool wasRemoved = _repo.DeleteContent("the room");

            Assert.IsTrue(wasRemoved);

            // bool wasAlsoRemoved = _repo.DeleteContent("ihfosd");
            // Assert.IsFalse(wasAlsoRemoved);
        }
Esempio n. 2
0
        private void RemoveContentFromList()
        {
            Console.Clear();
            Console.WriteLine("Which item would you like to remove?");

            List <StreamingContent> contentList = _repo.GetContents();

            int count = 0;

            foreach (StreamingContent content in contentList)
            {
                count++;
                Console.WriteLine($"{count}, {content.Title}");
            }

            int targetContentId = int.Parse(Console.ReadLine());
            int targetIndex     = targetContentId - 1;

            if (targetIndex >= 0 && targetIndex < contentList.Count)
            {
                StreamingContent desiredContent = contentList[targetIndex];

                if (_repo.DeleteContent(desiredContent.Title))
                {
                    Console.WriteLine($"{desiredContent.Title} successfully updated.");
                }
                else
                {
                    Console.WriteLine("I'm sorry, I can't do that.");
                }
            }
            else
            {
                Console.WriteLine("No content has that ID");
            }
            Console.ReadKey();
        }
Esempio n. 3
0
        public void DeleteContent_ShouldDelete()
        {
            bool wasRemoved = _repo.DeleteContent("the room");

            Assert.IsTrue(wasRemoved);
        }