diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..3979093c1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,114 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '35 9 * * 6' + +env: + WEBAPP_SLN: BlogEngine.sln + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + # runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'windows-2019' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'csharp', 'javascript', 'ruby' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + # - name: Autobuild + # uses: github/codeql-action/autobuild@v2 + # - name: Setup dotnet + # uses: actions/setup-dotnet@v3 + # with: + # dotnet-version: '4.5.2' + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + # with: + # vs-version: '[16.4,16.5)' + + - name: Setup NuGet.exe for use with actions + uses: NuGet/setup-nuget@v1.1.1 + +# - name: Restore NuGet Packages +# run: nuget restore ${{ env.WEBAPP_SLN }} + + - name: Build non-csharp code + if: matrix.language != 'csharp' + uses: github/codeql-action/autobuild@v2 + + # Need to add test step - or maybe not for the *analyze* action... + + - name: Restore NuGet packages and build solution + if: matrix.language == 'csharp' + run: | + nuget restore ${{ env.WEBAPP_SLN }} + msbuild ${{ env.WEBAPP_SLN }} -t:rebuild -verbosity:diag -property:Configuration=Release + working-directory: ./BlogEngine + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.gitignore b/.gitignore index 5e7dd7079..b0dd040e0 100644 --- a/.gitignore +++ b/.gitignore @@ -188,3 +188,6 @@ BlogEngine/.vs/ BlogEngine/BlogEngine.NET/App_Data/datastore/extensions/*.xml /.vs/slnx.sqlite /.vs/BlogEngine.NET/config/applicationhost.config +.vs/VSWorkspaceState.json +/.mailmap +/BlogEngine/BlogEngine.NET/App_Data/logger.txt diff --git a/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWACategory.cs b/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWACategory.cs index e53779fb3..8dad3dda8 100644 --- a/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWACategory.cs +++ b/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWACategory.cs @@ -17,7 +17,7 @@ internal struct MWACategory /// Url to thml display of category /// public string htmlUrl; - +#pragma warning disable 649 /// /// The guid of the category /// @@ -35,4 +35,5 @@ internal struct MWACategory #endregion } +#pragma warning restore 649 } \ No newline at end of file diff --git a/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWAUserInfo.cs b/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWAUserInfo.cs index 069f24680..4fe28ead5 100644 --- a/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWAUserInfo.cs +++ b/BlogEngine/BlogEngine.Core/API/MetaWeblog/MWAUserInfo.cs @@ -1,5 +1,6 @@ namespace BlogEngine.Core.API.MetaWeblog { +#pragma warning disable 649 /// /// MetaWeblog UserInfo struct /// returned from GetUserInfo call @@ -18,7 +19,8 @@ internal struct MWAUserInfo /// Login ID /// public string userID; - + // q: how can I disable a warning for a single line? +// a: http://stackoverflow.com/questions/281457/what-is-the-c-sharp-version-of-pragma-warning-disable-xxxx-in-visual-studio /// /// Url to User Blog? /// @@ -39,4 +41,5 @@ internal struct MWAUserInfo /// public string firstName; } +#pragma warning restore 649 } \ No newline at end of file diff --git a/BlogEngine/BlogEngine.Core/API/MetaWeblog/XMLRPCRequest.cs b/BlogEngine/BlogEngine.Core/API/MetaWeblog/XMLRPCRequest.cs index d2fd04f58..b1ce2dc73 100644 --- a/BlogEngine/BlogEngine.Core/API/MetaWeblog/XMLRPCRequest.cs +++ b/BlogEngine/BlogEngine.Core/API/MetaWeblog/XMLRPCRequest.cs @@ -498,7 +498,7 @@ private static string ParseRequest(HttpContext context) var buffer = new byte[context.Request.InputStream.Length]; context.Request.InputStream.Position = 0; - context.Request.InputStream.Read(buffer, 0, buffer.Length); + _ = context.Request.InputStream.Read(buffer, 0, buffer.Length); return Encoding.UTF8.GetString(buffer); } diff --git a/BlogEngine/BlogEngine.Core/AuthorProfile.cs b/BlogEngine/BlogEngine.Core/AuthorProfile.cs index 141a3f3d8..45f7b31ec 100644 --- a/BlogEngine/BlogEngine.Core/AuthorProfile.cs +++ b/BlogEngine/BlogEngine.Core/AuthorProfile.cs @@ -138,7 +138,7 @@ static AuthorProfile() // remove deleted blog from static 'profiles' if (profiles != null && profiles.ContainsKey(blog.Id)) - profiles.Remove(blog.Id); + _ = profiles.Remove(blog.Id); } } }; @@ -177,7 +177,7 @@ public string AboutMe set { - base.SetValue("AboutMe", value, ref this.aboutMe); + _ = base.SetValue("AboutMe", value, ref this.aboutMe); } } @@ -193,7 +193,7 @@ public DateTime Birthday set { - base.SetValue("Birthday", value, ref this.birthday); + _ = base.SetValue("Birthday", value, ref this.birthday); } } @@ -209,7 +209,7 @@ public string CityTown set { - base.SetValue("CityTown", value, ref this.cityTown); + _ = base.SetValue("CityTown", value, ref this.cityTown); } } @@ -225,7 +225,7 @@ public string Company set { - base.SetValue("Company", value, ref this.company); + _ = base.SetValue("Company", value, ref this.company); } } @@ -241,7 +241,7 @@ public string Country set { - base.SetValue("Country", value, ref this.country); + _ = base.SetValue("Country", value, ref this.country); } } @@ -257,7 +257,7 @@ public string DisplayName set { - base.SetValue("DisplayName", value, ref this.displayName); + _ = base.SetValue("DisplayName", value, ref this.displayName); } } @@ -273,7 +273,7 @@ public string EmailAddress set { - base.SetValue("EmailAddress", value, ref this.emailAddress); + _ = base.SetValue("EmailAddress", value, ref this.emailAddress); } } @@ -289,7 +289,7 @@ public string FirstName set { - base.SetValue("FirstName", value, ref this.firstName); + _ = base.SetValue("FirstName", value, ref this.firstName); } } @@ -316,7 +316,7 @@ public bool Private set { - base.SetValue("Private", value, ref this.isprivate); + _ = base.SetValue("Private", value, ref this.isprivate); } } @@ -332,7 +332,7 @@ public string LastName set { - base.SetValue("LastName", value, ref this.lastName); + _ = base.SetValue("LastName", value, ref this.lastName); } } @@ -348,7 +348,7 @@ public string MiddleName set { - base.SetValue("MiddleName", value, ref this.middleName); + _ = base.SetValue("MiddleName", value, ref this.middleName); } } @@ -364,7 +364,7 @@ public string PhoneFax set { - base.SetValue("PhoneFax", value, ref this.phoneFax); + _ = base.SetValue("PhoneFax", value, ref this.phoneFax); } } @@ -380,7 +380,7 @@ public string PhoneMain set { - base.SetValue("PhoneMain", value, ref this.phoneMain); + _ = base.SetValue("PhoneMain", value, ref this.phoneMain); } } @@ -396,7 +396,7 @@ public string PhoneMobile set { - base.SetValue("PhoneMobile", value, ref this.phoneMobile); + _ = base.SetValue("PhoneMobile", value, ref this.phoneMobile); } } @@ -412,7 +412,7 @@ public string PhotoUrl set { - base.SetValue("PhotoUrl", value, ref this.photoUrl); + _ = base.SetValue("PhotoUrl", value, ref this.photoUrl); } } @@ -428,7 +428,7 @@ public string RegionState set { - base.SetValue("RegionState", value, ref this.regionState); + _ = base.SetValue("RegionState", value, ref this.regionState); } } @@ -571,7 +571,7 @@ public static Profile ToJson(string username) /// Blog ID public static void RemoveProfile(Guid blogId) { - profiles.Remove(blogId); + _ = profiles.Remove(blogId); } #endregion @@ -586,7 +586,7 @@ protected override void DataDelete() BlogService.DeleteProfile(this); if (Profiles.Contains(this)) { - Profiles.Remove(this); + _ = Profiles.Remove(this); } } diff --git a/BlogEngine/BlogEngine.Core/BlogEngine.Core.csproj b/BlogEngine/BlogEngine.Core/BlogEngine.Core.csproj index 47d8bb39b..1d33d120d 100644 --- a/BlogEngine/BlogEngine.Core/BlogEngine.Core.csproj +++ b/BlogEngine/BlogEngine.Core/BlogEngine.Core.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -40,9 +40,15 @@ 1.0.0.%2a false true - v4.5 + v4.5.2 + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + true full @@ -56,6 +62,7 @@ false -Microsoft.Design#CA1020 false + BlogEngine.Core.ruleset pdbonly @@ -67,6 +74,7 @@ bin\Release\BlogEngine.Core.XML true false + BlogEngine.Core.ruleset @@ -391,6 +399,7 @@ + diff --git a/BlogEngine/BlogEngine.Core/BlogEngine.Core.ruleset b/BlogEngine/BlogEngine.Core/BlogEngine.Core.ruleset new file mode 100644 index 000000000..d6d249482 --- /dev/null +++ b/BlogEngine/BlogEngine.Core/BlogEngine.Core.ruleset @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.Core/BusinessBase.cs b/BlogEngine/BlogEngine.Core/BusinessBase.cs index addbb145f..85edab2ff 100644 --- a/BlogEngine/BlogEngine.Core/BusinessBase.cs +++ b/BlogEngine/BlogEngine.Core/BusinessBase.cs @@ -109,7 +109,7 @@ public DateTime DateCreated set { - this.SetValue("DateCreated", value, ref this.dateCreated); + _ = this.SetValue("DateCreated", value, ref this.dateCreated); } } @@ -125,7 +125,7 @@ public DateTime DateModified set { - this.SetValue("DateModifier", value, ref this.dateModified); + _ = this.SetValue("DateModifier", value, ref this.dateModified); } } @@ -200,7 +200,7 @@ public virtual string ValidationMessage var sb = new StringBuilder(); foreach (string messages in this.brokenRules.Values) { - sb.AppendLine(messages); + _ = sb.AppendLine(messages); } return sb.ToString(); @@ -405,7 +405,7 @@ public virtual SaveAction Save() /// public void AcceptChanges() { - this.Save(); + _ = this.Save(); } #endregion @@ -437,7 +437,7 @@ protected virtual void MarkChanged(string propertyName) // No need to check for duplicates since changedProperties // is just a HashSet. - this.changedProperties.Add(propertyName); + _ = this.changedProperties.Add(propertyName); this.OnPropertyChanged(propertyName); } diff --git a/BlogEngine/BlogEngine.Core/Data/Contracts/IFileManagerRepository.cs b/BlogEngine/BlogEngine.Core/Data/Contracts/IFileManagerRepository.cs index 5e096b856..a4e916121 100644 --- a/BlogEngine/BlogEngine.Core/Data/Contracts/IFileManagerRepository.cs +++ b/BlogEngine/BlogEngine.Core/Data/Contracts/IFileManagerRepository.cs @@ -3,8 +3,19 @@ namespace BlogEngine.Core.Data.Contracts { + /// + /// Interface for a file manager repository. + /// public interface IFileManagerRepository { + /// + /// Find a file or collection of files. Provides paging interface. + /// + /// How many files to return. + /// How many to skip before starting to return. + /// UNDONE: Doc: More detail. Path of files to return. + /// Order in which to return files. + /// IEnumerable of file instances (FileInstance class). IEnumerable Find(int take = 10, int skip = 0, string path = "", string order = ""); } } diff --git a/BlogEngine/BlogEngine.Core/Data/Contracts/IPageRepository.cs b/BlogEngine/BlogEngine.Core/Data/Contracts/IPageRepository.cs index eea779401..d673b8708 100644 --- a/BlogEngine/BlogEngine.Core/Data/Contracts/IPageRepository.cs +++ b/BlogEngine/BlogEngine.Core/Data/Contracts/IPageRepository.cs @@ -27,19 +27,20 @@ public interface IPageRepository /// /// Add new page /// - /// Page + /// Page to add /// Saved page with new ID PageDetail Add(PageDetail page); /// /// Update page /// /// Page to update + /// Action to take /// True on success bool Update(PageDetail page, string action); /// /// Delete page /// - /// Page ID + /// Page ID to delete /// True on success bool Remove(Guid id); } diff --git a/BlogEngine/BlogEngine.Core/Helpers/Pager.cs b/BlogEngine/BlogEngine.Core/Helpers/Pager.cs index 4b0b59ea2..343864b61 100644 --- a/BlogEngine/BlogEngine.Core/Helpers/Pager.cs +++ b/BlogEngine/BlogEngine.Core/Helpers/Pager.cs @@ -85,7 +85,6 @@ public static void Reset(int page, int pageSize, int listCount) /// /// Renders pager HMTML /// - /// Current page /// Callback for JavaScript /// HTML markup public static string Render(string callback = "false") diff --git a/BlogEngine/BlogEngine.Core/Providers/BlogService.cs b/BlogEngine/BlogEngine.Core/Providers/BlogService.cs index 6d6100ece..498e7231d 100644 --- a/BlogEngine/BlogEngine.Core/Providers/BlogService.cs +++ b/BlogEngine/BlogEngine.Core/Providers/BlogService.cs @@ -884,7 +884,6 @@ public static void SaveCustomField(BlogEngine.Core.Data.Models.CustomField field /// /// Fills list of custom fields for a blog /// - /// Current blog /// List of custom fields public static List FillCustomFields() { diff --git a/BlogEngine/BlogEngine.Core/Service References/GalleryServer/Reference.cs b/BlogEngine/BlogEngine.Core/Service References/GalleryServer/Reference.cs index f30f504aa..8f7a051b1 100644 --- a/BlogEngine/BlogEngine.Core/Service References/GalleryServer/Reference.cs +++ b/BlogEngine/BlogEngine.Core/Service References/GalleryServer/Reference.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18033 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -9,7 +9,7 @@ //------------------------------------------------------------------------------ // Original file name: -// Generation date: 5/19/2013 12:18:41 PM +// Generation date: 8/26/2023 11:02:31 PM namespace BlogEngine.Core.GalleryServer { diff --git a/BlogEngine/BlogEngine.Core/Services/FileSystem/Directory.cs b/BlogEngine/BlogEngine.Core/Services/FileSystem/Directory.cs index 0f8666e5d..48470aee2 100644 --- a/BlogEngine/BlogEngine.Core/Services/FileSystem/Directory.cs +++ b/BlogEngine/BlogEngine.Core/Services/FileSystem/Directory.cs @@ -63,7 +63,7 @@ public string Name } internal set { - base.SetValue("Name", value, ref this.name); + _ = base.SetValue("Name", value, ref this.name); } } @@ -81,7 +81,7 @@ public string FullPath } internal set { - base.SetValue("FullPath", value, ref this.fullpath); + _ = base.SetValue("FullPath", value, ref this.fullpath); } } @@ -99,7 +99,7 @@ public bool IsRoot } internal set { - base.SetValue("IsRoot", value, ref this.isroot); + _ = base.SetValue("IsRoot", value, ref this.isroot); } } @@ -122,7 +122,7 @@ public Directory Parent } internal set { - base.SetValue("Parent", value, ref this.parent); + _ = base.SetValue("Parent", value, ref this.parent); } } @@ -142,7 +142,7 @@ public IEnumerable Directories } internal set { - base.SetValue("Directories", value, ref this.directories); + _ = base.SetValue("Directories", value, ref this.directories); } } @@ -162,7 +162,7 @@ public IEnumerable Files } internal set { - base.SetValue("Files", value, ref this.files); + _ = base.SetValue("Files", value, ref this.files); } } @@ -200,7 +200,7 @@ public void DeleteSubDirectory(string Name) /// /// Deletes the current directory, and all subsequent files /// - public void Delete() + public override void Delete() { BlogService.DeleteDirectory(this.FullPath); this.Dispose(); diff --git a/BlogEngine/BlogEngine.Core/Services/FileSystem/File.cs b/BlogEngine/BlogEngine.Core/Services/FileSystem/File.cs index e7efc8444..d6f021193 100644 --- a/BlogEngine/BlogEngine.Core/Services/FileSystem/File.cs +++ b/BlogEngine/BlogEngine.Core/Services/FileSystem/File.cs @@ -70,7 +70,7 @@ public byte[] FileContents } internal set { - base.SetValue("FileContents", value, ref this.contents); + _ = base.SetValue("FileContents", value, ref this.contents); } } @@ -88,7 +88,7 @@ public long FileSize } internal set { - base.SetValue("FileSize", value, ref this.fileSize); + _ = base.SetValue("FileSize", value, ref this.fileSize); } } @@ -111,7 +111,7 @@ public Directory ParentDirectory } internal set { - base.SetValue("ParentDirectory", value, ref this.parentDirectory); + _ = base.SetValue("ParentDirectory", value, ref this.parentDirectory); } } @@ -129,7 +129,7 @@ public string Name } internal set { - base.SetValue("Name", value, ref this.name); + _ = base.SetValue("Name", value, ref this.name); } } @@ -144,7 +144,7 @@ internal string FullPath } set { - base.SetValue("FullPath", value, ref this.fullpath); + _ = base.SetValue("FullPath", value, ref this.fullpath); } } @@ -162,7 +162,7 @@ public string FilePath } internal set { - base.SetValue("FilePath", value, ref this.filepath); + _ = base.SetValue("FilePath", value, ref this.filepath); } } @@ -264,7 +264,7 @@ public Image AsImage /// /// deletes the current file object from the storage container /// - public void Delete() + public override void Delete() { BlogService.DeleteFile(this.FullPath); this.Dispose(); diff --git a/BlogEngine/BlogEngine.Core/Web/Extensions/ManagedExtension.cs b/BlogEngine/BlogEngine.Core/Web/Extensions/ManagedExtension.cs index 496638989..ed9cad991 100644 --- a/BlogEngine/BlogEngine.Core/Web/Extensions/ManagedExtension.cs +++ b/BlogEngine/BlogEngine.Core/Web/Extensions/ManagedExtension.cs @@ -1,4 +1,4 @@ -namespace BlogEngine.Core.Web.Extensions +namespace BlogEngine.Core.Web.Extensions { using System; using System.Collections.Generic; diff --git a/BlogEngine/BlogEngine.Core/packages.config b/BlogEngine/BlogEngine.Core/packages.config index 233ae815a..48ba22c90 100644 --- a/BlogEngine/BlogEngine.Core/packages.config +++ b/BlogEngine/BlogEngine.Core/packages.config @@ -1,7 +1,7 @@  - - - - + + + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.designer.cs b/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.designer.cs index 63c3be1e5..db34cfa6c 100644 --- a/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.designer.cs +++ b/BlogEngine/BlogEngine.NET/App_GlobalResources/labels.designer.cs @@ -19,7 +19,7 @@ namespace Resources { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option or rebuild the Visual Studio project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class labels { @@ -5983,6 +5983,15 @@ internal static string settingsUpdated { } } + /// + /// Looks up a localized string similar to Share. + /// + internal static string share { + get { + return ResourceManager.GetString("share", resourceCulture); + } + } + /// /// Looks up a localized string similar to Short Biography. /// @@ -7460,4 +7469,4 @@ internal static string _default { } } } -} +} \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj b/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj index 8c97c76e2..e0129fa27 100644 --- a/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj +++ b/BlogEngine/BlogEngine.NET/BlogEngine.NET.csproj @@ -14,7 +14,7 @@ Properties BlogEngine.NET BlogEngine.NET - v4.5 + v4.5.2 true @@ -23,7 +23,17 @@ 1.6 + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + 3.1.0 + + true full @@ -66,6 +76,7 @@ ..\packages\SimpleInjector.Integration.WebApi.3.1.0\lib\net45\SimpleInjector.Integration.WebApi.dll True + @@ -78,8 +89,6 @@ - - False @@ -110,13 +119,13 @@ False ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - + False ..\packages\WebGrease.1.6.0\lib\WebGrease.dll @@ -1500,9 +1509,10 @@ - + + @@ -2230,12 +2240,6 @@ PostList.ascx - - - {9ed9914a-fb6e-4d21-8c71-9122e8c3076b} - BlogEngine.Core - - GlobalResourceProxyGenerator @@ -2433,6 +2437,12 @@ + + + {9ed9914a-fb6e-4d21-8c71-9122e8c3076b} + BlogEngine.Core + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) @@ -2447,9 +2457,9 @@ True True - 64079 + 65079 / - http://localhost:64079/ + http://localhost:65079/ False False diff --git a/BlogEngine/BlogEngine.NET/Scripts/angular-loader.js b/BlogEngine/BlogEngine.NET/Scripts/angular-loader.js index c80652b2b..380dec094 100644 --- a/BlogEngine/BlogEngine.NET/Scripts/angular-loader.js +++ b/BlogEngine/BlogEngine.NET/Scripts/angular-loader.js @@ -418,5 +418,4 @@ setupModuleLoader(window); * init: function(Function):angular.Module * } } */ -angular.Module; - +angular.Module; \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.intellisense.js b/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.intellisense.js index a88b6c6e3..805b51397 100644 --- a/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.intellisense.js +++ b/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.intellisense.js @@ -2666,5 +2666,4 @@ intellisense.annotate(window, { /// /// }, -}); - +}); \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.js b/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.js index eed17778c..5b782c220 100644 --- a/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.js +++ b/BlogEngine/BlogEngine.NET/Scripts/jquery-2.1.4.js @@ -9207,4 +9207,4 @@ if ( typeof noGlobal === strundefined ) { return jQuery; -})); +})); \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie-1.4.1.min.js b/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie-1.4.1.min.js new file mode 100644 index 000000000..c0f19d8a3 --- /dev/null +++ b/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie-1.4.1.min.js @@ -0,0 +1,2 @@ +/*! jquery.cookie v1.4.1 | MIT */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie.js b/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie.js index 927190008..c7f3a59b5 100644 --- a/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie.js +++ b/BlogEngine/BlogEngine.NET/Scripts/jquery.cookie.js @@ -1,5 +1,5 @@ /*! - * jQuery Cookie Plugin v1.4.0 + * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2013 Klaus Hartl @@ -7,10 +7,13 @@ */ (function (factory) { if (typeof define === 'function' && define.amd) { - // AMD. Register as anonymous module. + // AMD define(['jquery'], factory); + } else if (typeof exports === 'object') { + // CommonJS + factory(require('jquery')); } else { - // Browser globals. + // Browser globals factory(jQuery); } }(function ($) { @@ -38,13 +41,8 @@ try { // Replace server-side written pluses with spaces. // If we can't decode the cookie, ignore it, it's unusable. - s = decodeURIComponent(s.replace(pluses, ' ')); - } catch(e) { - return; - } - - try { // If we can't parse the cookie, ignore it, it's unusable. + s = decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s) : s; } catch(e) {} } @@ -57,12 +55,13 @@ var config = $.cookie = function (key, value, options) { // Write + if (value !== undefined && !$.isFunction(value)) { options = $.extend({}, config.defaults, options); if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); - t.setDate(t.getDate() + days); + t.setTime(+t + days * 864e+5); } return (document.cookie = [ @@ -106,12 +105,13 @@ config.defaults = {}; $.removeCookie = function (key, options) { - if ($.cookie(key) !== undefined) { - // Must not alter options, thus extending a fresh object... - $.cookie(key, '', $.extend({}, options, { expires: -1 })); - return true; + if ($.cookie(key) === undefined) { + return false; } - return false; + + // Must not alter options, thus extending a fresh object... + $.cookie(key, '', $.extend({}, options, { expires: -1 })); + return !$.cookie(key); }; })); diff --git a/BlogEngine/BlogEngine.NET/Web.Config b/BlogEngine/BlogEngine.NET/Web.Config index e698ac4f5..3b1b2c954 100644 --- a/BlogEngine/BlogEngine.NET/Web.Config +++ b/BlogEngine/BlogEngine.NET/Web.Config @@ -1,39 +1,39 @@ - + -
-
+
+
- + - + - + - + - + - + @@ -41,7 +41,7 @@ - + @@ -56,21 +56,21 @@ - - + + - + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + - + - + - + - - + + - - + + - - + + - - - - - - + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/BlogEngine/BlogEngine.NET/fonts/fontawesome-webfont.svg b/BlogEngine/BlogEngine.NET/fonts/fontawesome-webfont.svg index 6fd19abcb..aa38a318f 100644 --- a/BlogEngine/BlogEngine.NET/fonts/fontawesome-webfont.svg +++ b/BlogEngine/BlogEngine.NET/fonts/fontawesome-webfont.svg @@ -637,4 +637,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/fonts/glyphicons-halflings-regular.svg b/BlogEngine/BlogEngine.NET/fonts/glyphicons-halflings-regular.svg index 94fb5490a..f155876e1 100644 --- a/BlogEngine/BlogEngine.NET/fonts/glyphicons-halflings-regular.svg +++ b/BlogEngine/BlogEngine.NET/fonts/glyphicons-halflings-regular.svg @@ -285,4 +285,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.NET/packages.config b/BlogEngine/BlogEngine.NET/packages.config index 3b91a7143..6c99c2121 100644 --- a/BlogEngine/BlogEngine.NET/packages.config +++ b/BlogEngine/BlogEngine.NET/packages.config @@ -1,28 +1,28 @@  - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BlogEngine/BlogEngine.Tests/BlogEngine.Tests.csproj b/BlogEngine/BlogEngine.Tests/BlogEngine.Tests.csproj index 52c52b13f..5052f65b6 100644 --- a/BlogEngine/BlogEngine.Tests/BlogEngine.Tests.csproj +++ b/BlogEngine/BlogEngine.Tests/BlogEngine.Tests.csproj @@ -8,7 +8,7 @@ Properties BlogEngine.Tests BlogEngine.Tests - v4.5 + v4.5.2 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -16,7 +16,14 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + true full @@ -89,6 +96,7 @@ + diff --git a/BlogEngine/BlogEngine.Tests/Fakes/FakeCategoryRepository.cs b/BlogEngine/BlogEngine.Tests/Fakes/FakeCategoryRepository.cs index c50a1b8b3..ccc2c2849 100644 --- a/BlogEngine/BlogEngine.Tests/Fakes/FakeCategoryRepository.cs +++ b/BlogEngine/BlogEngine.Tests/Fakes/FakeCategoryRepository.cs @@ -7,16 +7,18 @@ namespace BlogEngine.Tests.Fakes { class FakeCategoryRepository : ICategoryRepository { + private const string testTitle = "test"; public IEnumerable Find(int take = 10, int skip = 0, string filter = "", string order = "") { - var items = new List(); - - items.Add(new CategoryItem() + var items = new List { - Id = Guid.NewGuid(), - Title = "test" - }); + new CategoryItem() + { + Id = Guid.NewGuid(), + Title = testTitle + } + }; return items; } @@ -26,7 +28,7 @@ public CategoryItem FindById(Guid id) return new CategoryItem() { Id = Guid.NewGuid(), - Title = "test" + Title = testTitle }; } @@ -35,7 +37,7 @@ public CategoryItem Add(CategoryItem item) return new CategoryItem() { Id = Guid.NewGuid(), - Title = "test" + Title = testTitle }; } diff --git a/BlogEngine/BlogEngine.Tests/Fakes/FakeCustomFieldsRepository.cs b/BlogEngine/BlogEngine.Tests/Fakes/FakeCustomFieldsRepository.cs index b60c0a9ce..d94cd0d1c 100644 --- a/BlogEngine/BlogEngine.Tests/Fakes/FakeCustomFieldsRepository.cs +++ b/BlogEngine/BlogEngine.Tests/Fakes/FakeCustomFieldsRepository.cs @@ -7,21 +7,25 @@ namespace BlogEngine.Tests.Fakes { class FakeCustomFieldsRepository : ICustomFieldRepository { + private const string testType = "test"; + public IEnumerable Find(string filter = "") { - var items = new List(); - items.Add(new CustomField { CustomType = "test", BlogId = new Guid() }); + var items = new List + { + new CustomField { CustomType = testType, BlogId = new Guid() } + }; return items; } public CustomField FindById(string type, string id, string key) { - return new CustomField { CustomType = "test", BlogId = new Guid() }; + return new CustomField { CustomType = testType, BlogId = new Guid() }; } public CustomField Add(CustomField item) { - return new CustomField { CustomType = "test", BlogId = new Guid() }; + return new CustomField { CustomType = testType, BlogId = new Guid() }; } public bool Update(CustomField item) diff --git a/BlogEngine/BlogEngine.Tests/WebApi/BlogControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/BlogControllerTests.cs index f1000303f..669bf6a62 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/BlogControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/BlogControllerTests.cs @@ -1,21 +1,17 @@ -using BlogEngine.Tests.Fakes; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; +using BlogEngine.Tests.Fakes; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; namespace BlogEngine.Tests.WebApi { [TestClass] public class BlogControllerTests { + private const string testBlogId = SharedTestData.testBlogId; private BlogsController _ctrl; [TestInitialize] @@ -23,14 +19,7 @@ public void Init() { _ctrl = new BlogsController(new FakeBlogRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "blogs" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "blogs"); } [TestMethod] @@ -43,7 +32,7 @@ public void BlogControllerGet() [TestMethod] public void BlogControllerGetById() { - var blog = _ctrl.Get("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var blog = _ctrl.Get(id: testBlogId); Assert.IsNotNull(blog); } @@ -65,7 +54,7 @@ public void BlogControllerPost() [TestMethod] public void BlogControllerUpdate() { - var result = _ctrl.Update(new BlogEngine.Core.Data.Models.Blog() + var result = _ctrl.Update(new Core.Data.Models.Blog() { Id = Guid.NewGuid() }); @@ -75,24 +64,17 @@ public void BlogControllerUpdate() [TestMethod] public void BlogControllerDelete() { - var result = _ctrl.Delete("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var result = _ctrl.Delete(testBlogId); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void BlogControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new BlogEngine.Core.Data.Models.Blog() + var items = new List(); + items.Add(new Core.Data.Models.Blog() { IsChecked = true, Id = Guid.NewGuid() diff --git a/BlogEngine/BlogEngine.Tests/WebApi/CategoryControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/CategoryControllerTests.cs index ac4500d46..6ddcaa03c 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/CategoryControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/CategoryControllerTests.cs @@ -6,17 +6,13 @@ using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; namespace BlogEngine.Tests.WebApi { [TestClass] public class CategoryControllerTests { + private const string testBlogId = SharedTestData.testBlogId; private CategoriesController _ctrl; [TestInitialize] @@ -24,14 +20,7 @@ public void Init() { _ctrl = new CategoriesController(new FakeCategoryRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "categories" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "categories"); } [TestMethod] @@ -44,7 +33,7 @@ public void CategoryControllerGet() [TestMethod] public void CategoryControllerGetById() { - var blog = _ctrl.Get("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var blog = _ctrl.Get(testBlogId); Assert.IsNotNull(blog); } @@ -74,28 +63,23 @@ public void CategoryControllerUpdate() [TestMethod] public void CategoryControllerDelete() { - var result = _ctrl.Delete("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var result = _ctrl.Delete(testBlogId); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void CategoryControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new CategoryItem() + var items = new List { - IsChecked = true, - Id = Guid.NewGuid() - }); + new CategoryItem() + { + IsChecked = true, + Id = Guid.NewGuid() + } + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/BlogEngine/BlogEngine.Tests/WebApi/CommentControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/CommentControllerTests.cs index aca9dd698..b25a2696f 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/CommentControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/CommentControllerTests.cs @@ -1,15 +1,10 @@ -using BlogEngine.Core.Data.Models; -using BlogEngine.Tests.Fakes; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; +using BlogEngine.Core.Data.Models; +using BlogEngine.Tests.Fakes; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace BlogEngine.Tests.WebApi { @@ -23,14 +18,7 @@ public void Init() { _ctrl = new CommentsController(new FakeCommentRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "comments" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "comments"); } [TestMethod] @@ -63,24 +51,19 @@ public void CommentsControllerUpdate() [TestMethod] public void CommentsControllerDelete() { - var result = _ctrl.Delete("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var result = _ctrl.Delete(SharedTestData.testBlogId); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void CommentsControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new CommentItem() { IsChecked = true, Id = Guid.NewGuid() }); + var items = new List + { + new CommentItem() { IsChecked = true, Id = Guid.NewGuid() } + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/BlogEngine/BlogEngine.Tests/WebApi/CustomFieldsControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/CustomFieldsControllerTests.cs index 90b4aa9d4..314382305 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/CustomFieldsControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/CustomFieldsControllerTests.cs @@ -1,15 +1,10 @@ -using BlogEngine.Core.Data.Models; -using BlogEngine.Tests.Fakes; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; +using BlogEngine.Core.Data.Models; +using BlogEngine.Tests.Fakes; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace BlogEngine.Tests.WebApi { @@ -23,14 +18,7 @@ public void Init() { _ctrl = new CustomFieldsController(new FakeCustomFieldsRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "customfields" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "customfields"); } [TestMethod] @@ -50,8 +38,10 @@ public void CustomFieldsControllerGet() [TestMethod] public void CustomFieldsControllerUpdate() { - var items = new List(); - items.Add(new CustomField { CustomType = "test", BlogId = new Guid() }); + var items = new List + { + new CustomField { CustomType = "test", BlogId = new Guid() } + }; var result = _ctrl.Put(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } diff --git a/BlogEngine/BlogEngine.Tests/WebApi/PackagesControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/PackagesControllerTests.cs index 3b885fb1d..6ad48d3f8 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/PackagesControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/PackagesControllerTests.cs @@ -1,13 +1,8 @@ -using BlogEngine.Core.Data.Models; +using System.Collections.Generic; +using System.Linq; +using BlogEngine.Core.Data.Models; using BlogEngine.Tests.Fakes; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; namespace BlogEngine.Tests.WebApi { @@ -21,14 +16,7 @@ public void Init() { _ctrl = new PackagesController(new FakePackagesRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "packages" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "packages"); } [TestMethod] @@ -55,17 +43,12 @@ public void PackageControllerUpdate() [TestMethod] public void PackagesControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "install" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "install"); - var items = new List(); - items.Add(new Package() { Id = "test" }); + var items = new List() + { + new Package() { Id = "test" } + }; var result = _ctrl.ProcessChecked(items); Assert.IsTrue(result.IsSuccessStatusCode); diff --git a/BlogEngine/BlogEngine.Tests/WebApi/PageControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/PageControllerTests.cs index 44ccbcb8c..f3b1721c0 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/PageControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/PageControllerTests.cs @@ -1,22 +1,18 @@ -using BlogEngine.Core.Data.Models; -using BlogEngine.Tests.Fakes; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; +using BlogEngine.Core.Data.Models; +using BlogEngine.Tests.Fakes; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; namespace BlogEngine.Tests.WebApi { [TestClass] public class PageControllerTests { + private const string testBlogId = SharedTestData.testBlogId; private PagesController _ctrl; [TestInitialize] @@ -24,14 +20,7 @@ public void Init() { _ctrl = new PagesController(new FakePageRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "pages" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "pages"); } [TestMethod] @@ -44,7 +33,7 @@ public void PageControllerGet() [TestMethod] public void PageControllerGetById() { - var item = _ctrl.Get("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var item = _ctrl.Get(testBlogId); Assert.IsNotNull(item); } @@ -74,28 +63,23 @@ public void PageControllerUpdate() [TestMethod] public void PageControllerDelete() { - var result = _ctrl.Delete("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var result = _ctrl.Delete(testBlogId); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void PageControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new PageDetail() + var items = new List { - IsChecked = true, - Id = Guid.NewGuid() - }); + new PageDetail() + { + IsChecked = true, + Id = Guid.NewGuid() + } + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/BlogEngine/BlogEngine.Tests/WebApi/PostControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/PostControllerTests.cs index a9e564034..ee081a28a 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/PostControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/PostControllerTests.cs @@ -1,22 +1,18 @@ -using BlogEngine.Core.Data.Models; -using BlogEngine.Tests.Fakes; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Newtonsoft.Json; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; +using BlogEngine.Core.Data.Models; +using BlogEngine.Tests.Fakes; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Newtonsoft.Json; namespace BlogEngine.Tests.WebApi { [TestClass] public class PostControllerTests { + private const string testBlogId = SharedTestData.testBlogId; private PostsController _ctrl; [TestInitialize] @@ -24,14 +20,7 @@ public void Init() { _ctrl = new PostsController(new FakePostRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "posts" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "posts"); } [TestMethod] @@ -44,7 +33,7 @@ public void PostControllerGet() [TestMethod] public void PostControllerGetById() { - var item = _ctrl.Get("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var item = _ctrl.Get(testBlogId); Assert.IsNotNull(item); } @@ -74,28 +63,23 @@ public void PostControllerUpdate() [TestMethod] public void PostControllerDelete() { - var result = _ctrl.Delete("96d5b379-7e1d-4dac-a6ba-1e50db561b04"); + var result = _ctrl.Delete(SharedTestData.testBlogId); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void PostControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new PostDetail() + var items = new List { - IsChecked = true, - Id = Guid.NewGuid() - }); + new PostDetail() + { + IsChecked = true, + Id = Guid.NewGuid() + } + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/BlogEngine/BlogEngine.Tests/WebApi/RoleControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/RoleControllerTests.cs index a69859988..fd9ed5f8a 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/RoleControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/RoleControllerTests.cs @@ -1,21 +1,17 @@ -using BlogEngine.Core.Data.Models; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using BlogEngine.Core.Data.Models; using BlogEngine.Tests.Fakes; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; namespace BlogEngine.Tests.WebApi { [TestClass] public class RoleControllerTests { + private const string roleTest = "test"; private RolesController _ctrl; [TestInitialize] @@ -23,14 +19,7 @@ public void Init() { _ctrl = new RolesController(new FakeRolesRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "roles" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "roles"); } [TestMethod] @@ -43,14 +32,14 @@ public void RoleControllerGet() [TestMethod] public void RoleControllerGetById() { - var item = _ctrl.Get("test"); + var item = _ctrl.Get(roleTest); Assert.IsNotNull(item); } [TestMethod] public void RoleControllerPost() { - var result = _ctrl.Post(new RoleItem { RoleName = "test" }); + var result = _ctrl.Post(new RoleItem { RoleName = roleTest }); Assert.AreEqual(HttpStatusCode.Created, result.StatusCode); var json = result.Content.ReadAsStringAsync().Result; @@ -71,24 +60,19 @@ public void RoleControllerUpdate() [TestMethod] public void RoleControllerDelete() { - var result = _ctrl.Delete("test"); + var result = _ctrl.Delete(roleTest); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void RoleControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new RoleItem()); + var items = new List + { + new RoleItem() + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); @@ -97,14 +81,14 @@ public void RoleControllerProcessChecked() [TestMethod] public void RoleControllerGetRights() { - var result = _ctrl.GetRights("test"); + var result = _ctrl.GetRights(roleTest); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } [TestMethod] public void RoleControllerGetUserRiles() { - var result = _ctrl.GetUserRoles("test"); + var result = _ctrl.GetUserRoles(roleTest); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } @@ -112,7 +96,7 @@ public void RoleControllerGetUserRiles() public void RoleControllerSaveRights() { var rights = new List(); - var result = _ctrl.SaveRights(rights, "test"); + var result = _ctrl.SaveRights(rights, roleTest); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); } } diff --git a/BlogEngine/BlogEngine.Tests/WebApi/SharedTestData.cs b/BlogEngine/BlogEngine.Tests/WebApi/SharedTestData.cs new file mode 100644 index 000000000..6a67f075e --- /dev/null +++ b/BlogEngine/BlogEngine.Tests/WebApi/SharedTestData.cs @@ -0,0 +1,45 @@ +using System; +using System.Net.Http; +using System.Web.Http; +using System.Web.Http.Controllers; +using System.Web.Http.Hosting; +using System.Web.Http.Routing; + +namespace BlogEngine.Tests.WebApi +{ + internal class SharedTestData + { + /// + /// ID for blog used in tests (matches ID in FakeBlogRepository) + /// + public const string testBlogId = "96d5b379-7e1d-4dac-a6ba-1e50db561b04"; + + static internal void InitializeController(ApiController initController, + string whichController, + string whichAction) + { + if (initController is null) + { + throw new ArgumentNullException(nameof(initController)); + } + + if (string.IsNullOrEmpty(whichController)) + { + throw new ArgumentException($"'{nameof(whichController)}' cannot be null or empty.", nameof(whichController)); + } + + if (string.IsNullOrEmpty(whichAction)) + { + throw new ArgumentException($"'{nameof(whichAction)}' cannot be null or empty.", nameof(whichAction)); + } + + var config = new HttpConfiguration(); + var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); + var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); + var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { whichController, whichAction } }); + initController.ControllerContext = new HttpControllerContext(config, routeData, request); + initController.Request = request; + initController.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + } + } +} \ No newline at end of file diff --git a/BlogEngine/BlogEngine.Tests/WebApi/TagControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/TagControllerTests.cs index 10c8ff543..0f3b16ce8 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/TagControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/TagControllerTests.cs @@ -1,13 +1,8 @@ -using BlogEngine.Core.Data.Models; +using System.Collections.Generic; +using System.Net; +using BlogEngine.Core.Data.Models; using BlogEngine.Tests.Fakes; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; namespace BlogEngine.Tests.WebApi { @@ -21,14 +16,7 @@ public void Init() { _ctrl = new TagsController(new FakeTagsRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "tags" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "tags"); } [TestMethod] @@ -55,21 +43,16 @@ public void TagsControllerDelete() [TestMethod] public void TagsControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new TagItem() + var items = new List { - IsChecked = true, - TagName = "test" - }); + new TagItem() + { + IsChecked = true, + TagName = "test" + } + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/BlogEngine/BlogEngine.Tests/WebApi/TrashControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/TrashControllerTests.cs index 7eb779c49..3c32808d6 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/TrashControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/TrashControllerTests.cs @@ -1,12 +1,7 @@ -using BlogEngine.Core.Data.Models; +using System.Net; +using BlogEngine.Core.Data.Models; using BlogEngine.Tests.Fakes; using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; namespace BlogEngine.Tests.WebApi { @@ -19,14 +14,8 @@ public class TrashControllerTests public void Init() { _ctrl = new TrashController(new FakeTrashRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "trash" } }); - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "trash"); } [TestMethod] diff --git a/BlogEngine/BlogEngine.Tests/WebApi/UserControllerTests.cs b/BlogEngine/BlogEngine.Tests/WebApi/UserControllerTests.cs index 13446ca92..a698e690c 100644 --- a/BlogEngine/BlogEngine.Tests/WebApi/UserControllerTests.cs +++ b/BlogEngine/BlogEngine.Tests/WebApi/UserControllerTests.cs @@ -1,14 +1,9 @@ -using BlogEngine.Core.Data.Models; +using System.Collections.Generic; +using System.Net; +using BlogEngine.Core.Data.Models; using BlogEngine.Tests.Fakes; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Hosting; -using System.Web.Http.Routing; namespace BlogEngine.Tests.WebApi { @@ -21,14 +16,8 @@ public class UserControllerTests public void Init() { _ctrl = new UsersController(new FakeUsersRepository()); - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "users" } }); - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "controller", "users"); } [TestMethod] @@ -73,17 +62,12 @@ public void UsersControllerDelete() [TestMethod] public void UsersControllerProcessChecked() { - var config = new HttpConfiguration(); - var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/be/api"); - var route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}"); - var routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "id", "delete" } }); - - _ctrl.ControllerContext = new HttpControllerContext(config, routeData, request); - _ctrl.Request = request; - _ctrl.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config; + SharedTestData.InitializeController(_ctrl, "id", "delete"); - var items = new List(); - items.Add(new BlogUser()); + var items = new List + { + new BlogUser() + }; var result = _ctrl.ProcessChecked(items); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/BlogEngine/BlogEngine.Tests/app.config b/BlogEngine/BlogEngine.Tests/app.config index d9ebf21a5..a4b640645 100644 --- a/BlogEngine/BlogEngine.Tests/app.config +++ b/BlogEngine/BlogEngine.Tests/app.config @@ -1,31 +1,31 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff --git a/BlogEngine/BlogEngine.Tests/packages.config b/BlogEngine/BlogEngine.Tests/packages.config index 917157a55..5e355d5e5 100644 --- a/BlogEngine/BlogEngine.Tests/packages.config +++ b/BlogEngine/BlogEngine.Tests/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + \ No newline at end of file diff --git a/README.md b/README.md index e25437ff2..2c6951697 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# I recommend **not** using this project at the moment. +

+ This specific fork of it, at least (or its origin, either; it's not going to be easy to update to a more modern framework, either back-end or front-end, and it doesn't seem likely the original maintainers have plans in that direction). I'm working out some things here for my own personal edification. Feel free to look around, though, and see what's going on. :blush:

+

BlogEngine is an open source blogging platform since 2007.
Easily customizable. Many free built-in Themes, Widgets, and Plugins.