コード例 #1
0
        private void DeleteExistingBadgeValue()
        {
            Console.Clear();
            Console.WriteLine("Please choose the item you'd like to update:");
            List <KomodoInsuranceContent> contentList = new List <KomodoInsuranceContent>();
            int count = 0;

            foreach (KomodoInsuranceContent content in contentList)
            {
                count++;
                Console.WriteLine($"{count} - {content.ListOfDoorNames}");
            }
            int targetContentId = int.Parse(Console.ReadLine());
            int targetIndex     = targetContentId - 1;

            if (targetIndex >= 0 && targetIndex < contentList.Count)
            {
                KomodoInsuranceContent desiredContent = contentList[targetIndex];
                if (_kiRepo.DeleteExistingBadgeValue(desiredContent))
                {
                    Console.WriteLine($"{desiredContent.ListOfDoorNames} has been removed ");
                }
                else
                {
                    Console.WriteLine("Input invalid ");
                }
            }
            else
            {
                Console.WriteLine("No content had that ID ");
            }
            Console.WriteLine("Press any key to continue....");
            Console.ReadKey();
        }
コード例 #2
0
        public void DeleteExistingContent_ShouldReturnTrue()
        {
            KomodoInsuranceContent toBeDeleted = _kirepo.GetContentByBadgeID(9);

            bool removeResult = _kirepo.DeleteExistingBadgeValue(toBeDeleted);

            Assert.IsTrue(removeResult);
        }