BetterCms.Test.Module.Pages.CommandTests.WidgetTests.DeleteWidgetCommandTest.Should_Delete_HtmlContentWidget_Successfully C# (CSharp) Метод

Should_Delete_HtmlContentWidget_Successfully() приватный Метод

private Should_Delete_HtmlContentWidget_Successfully ( ) : void
Результат void
        public void Should_Delete_HtmlContentWidget_Successfully()
        {
            var htmlContentWidget = TestDataProvider.CreateNewHtmlContentWidget();

            RunActionInTransaction(session =>
            {
                session.SaveOrUpdate(htmlContentWidget);
                session.Flush();
                session.Clear();

                var uow = new DefaultUnitOfWork(session);
                var repository = new DefaultRepository(uow);
                var optionService = new Mock<IOptionService>().Object;
                var contentService = new Mock<IContentService>().Object;
                var childContentService = new Mock<IChildContentService>().Object;
                var categoryService = new Mock<ICategoryService>();
                var cmsConfiguration = new Mock<ICmsConfiguration>().Object;
                var widgetService = new DefaultWidgetService(repository, uow, optionService, contentService, childContentService, categoryService.Object, cmsConfiguration);

                var command = new DeleteWidgetCommand(widgetService);

                bool success = command.Execute(new DeleteWidgetRequest
                                                    {
                                                        WidgetId = htmlContentWidget.Id,
                                                        Version = htmlContentWidget.Version
                                                    });
                Assert.IsTrue(success);
            });
        }
    }