public void TestFailToDeletePremadeTemplate()
        {
            var testTtemplate = _service.GetTemplateByNameKind(String.Empty, null);
            var item          = testTtemplate.First(t => t.CanDelete == false);

            var ex = Assert.Throws <Exception>(() => _service.DeleteTemplate(item, null));

            Assert.That(ex.Message, Is.EqualTo("Cannot delete a pre-made template."));
        }
Ejemplo n.º 2
0
        private void deleteTemplate_Click(object sender, System.EventArgs e)
        {
            var template = (JobTemplate)lbxTemplate.SelectedItem;

            if (template != null)
            {
                var ds = Wrap(() => _service.DeleteTemplate(template, GetSelectedMealKind()));

                if (ds != null)
                {
                    lbxTemplate.DataSource = ds;
                }
            }
        }