Exemplo n.º 1
0
        public void TestIfUpdatePublisherInvokesSetValues()
        {
            var Publisher = new Publisher()
            {
                Name = "AAA"
            };

            try { publisherBusiness.Update(Publisher); }
            catch { mockContext.Verify(m => m.Entry(It.IsAny <Publisher>()), Times.Once()); }
        }
Exemplo n.º 2
0
        private void Update()
        {
            Console.WriteLine("Enter Publisher to update: ");
            string    publisherName = Console.ReadLine();
            Publisher publisher     = publisherBusiness.Get(publisherName);

            if (publisher != null)
            {
                Console.WriteLine("Enter new Publisher name: ");
                publisher.Name = Console.ReadLine();
                Console.WriteLine("Enter new Publisher country: ");
                publisher.CountryOfOrigin = Console.ReadLine();
                Console.WriteLine("Enter new Publisher website: ");
                publisher.Website = Console.ReadLine();
                publisherBusiness.Update(publisher);
            }
            else
            {
                Console.WriteLine("Publisher not found!");
            }
        }