public void SetUp() { var newsId = ServerOperations.News().CreatePublishedNewsItem(News1); var relatedNewsId = ServerOperations.News().CreatePublishedNewsItem(News2); var providerName = NewsManager.GetManager().Provider.Name; ServerOperations.RelatedData().AddRelatedDataCustomField(ContentTypeFullNames.NewsItem, ContentTypeFullNames.NewsItem, AddRelatedDataToNewsWidget.FieldName, providerName: providerName); ServerOperations.RelatedData().RelateItem( ContentTypeFullNames.NewsItem, newsId, ContentTypeFullNames.NewsItem, relatedNewsId, AddRelatedDataToNewsWidget.FieldName); Guid pageId = ServerOperations.Pages().CreatePage(PageName); ServerOperationsFeather.Pages().AddNewsWidgetToPage(pageId); string filePath = FileInjectHelper.GetDestinationFilePath(this.viewPath); Directory.CreateDirectory(Path.GetDirectoryName(filePath)); Stream destination = new FileStream(filePath, FileMode.Create, FileAccess.Write); var assembly = ServerOperationsFeather.Pages().GetTestUtilitiesAssembly(); Stream source = assembly.GetManifestResourceStream(FileResource); FileInjectHelper.CopyStream(source, destination); source.Close(); destination.Close(); }
public void TearDown() { Telerik.Sitefinity.TestUtilities.CommonOperations.ServerOperations.News().DeleteAllNews(); Telerik.Sitefinity.TestUtilities.CommonOperations.ServerOperations.Pages().DeleteAllPages(); ServerOperations.RelatedData().RemoveRelatedDataFieldFromContex(ContentTypeFullNames.NewsItem, AddRelatedDataToNewsWidget.FieldName); string filePath = FileInjectHelper.GetDestinationFilePath(this.viewPath); File.Delete(filePath); }