Ejemplo n.º 1
0
        public void ctr_should_delete_setting()
        {
            var key  = Guid.NewGuid().ToString();
            var vmdl = new SettingViewModel
            {
                Key   = key,
                Value =
                    "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
            };

            var obj = (ctr.PostSetting(vmdl) as OkObjectResult)?.Value as SettingViewModel;

            Assert.NotNull(obj);
            var setting = Bl.GetSetting(key);

            Assert.NotNull(setting);

            ctr.DeleteSetting(key);

            var notFoundResult = ctr.GetSetting(key) as NotFoundResult;

            Assert.NotNull(notFoundResult);
        }