public void TestUpdateTemplate_Throws_ItemNotFoundException()
        {
            var service  = new TemplatesService(new TemplatesErrorStubDao());
            var expected = new Template {
                Id = Guid.NewGuid(), Name = "Updated name"
            };

            Assert.Throws <ItemNotFoundServiceException>(() => { service.UpdateTemplate(expected); });
        }
        public void TestUpdateTemplate_Succesful_Update()
        {
            var service       = new TemplatesService(new TemplatesStubDao());
            var stubTemplates = service.GetTemplates();
            var actual        = stubTemplates[0];
            var expected      = new Template {
                Id = actual.Id, Name = "Updated name"
            };

            service.UpdateTemplate(expected);

            Assert.Equal(expected.Name, actual.Name);
        }
        public void TestUpdateTemplate_ItemNotFoundException_Message()
        {
            var service  = new TemplatesService(new TemplatesErrorStubDao());
            var expected = new Template {
                Id = Guid.NewGuid(), Name = "Updated name"
            };
            var origMessage = $"Couldn't find template with id {expected.Id}";

            try
            {
                service.UpdateTemplate(expected);
            }
            catch (Exception e)
            {
                Assert.Equal(e.Message, origMessage);
            }
        }