From de0bb494a5eb1c7a27189428568db21dcf4d237b Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 8 Jul 2016 14:51:02 +0200 Subject: [PATCH] Improving Build.bat and appveyor build output Moving all Console.Write* to Debug.Print --- .gitignore | 1 + appveyor.yml | 31 +++++----- build/Build.bat | 59 +++++++++++++++---- build/InstallGit.cmd | 4 +- .../DeepCloneRuntimeCacheProviderTests.cs | 3 +- .../Cache/HttpRuntimeCacheProviderTests.cs | 3 +- src/Umbraco.Tests/CodeFirst/CodeFirstTests.cs | 5 +- .../ContentTypeDefinitionFactory.cs | 5 +- .../CodeFirst/StronglyTypedMapperTest.cs | 3 +- .../CoreXml/NavigableNavigatorTests.cs | 4 +- .../ExtensionMethodFinderTests.cs | 5 +- src/Umbraco.Tests/LibraryTests.cs | 3 +- .../Logging/AsyncRollingFileAppenderTest.cs | 3 +- .../Logging/ParallelForwarderTest.cs | 6 +- .../Migrations/AlterMigrationTests.cs | 7 ++- .../Migrations/FindingMigrationsTest.cs | 3 +- .../Migrations/MigrationIssuesTests.cs | 3 +- .../TargetVersionSixthMigrationsTest.cs | 3 +- src/Umbraco.Tests/Models/ContentTests.cs | 3 +- src/Umbraco.Tests/Models/ContentTypeTests.cs | 7 ++- .../Models/DataTypeDefinitionTests.cs | 3 +- .../Models/DictionaryItemTests.cs | 3 +- .../Models/DictionaryTranslationTests.cs | 3 +- src/Umbraco.Tests/Models/LanguageTests.cs | 3 +- src/Umbraco.Tests/Models/MemberGroupTests.cs | 3 +- src/Umbraco.Tests/Models/MemberTests.cs | 3 +- .../Models/PropertyGroupTests.cs | 3 +- src/Umbraco.Tests/Models/PropertyTypeTests.cs | 3 +- src/Umbraco.Tests/Models/RelationTests.cs | 3 +- src/Umbraco.Tests/Models/RelationTypeTests.cs | 3 +- src/Umbraco.Tests/Models/StylesheetTests.cs | 3 +- src/Umbraco.Tests/Models/TaskTests.cs | 3 +- src/Umbraco.Tests/Models/TaskTypeTests.cs | 3 +- src/Umbraco.Tests/Models/TemplateTests.cs | 3 +- .../Models/UmbracoEntityTests.cs | 3 +- src/Umbraco.Tests/Models/UserTests.cs | 3 +- src/Umbraco.Tests/Models/UserTypeTests.cs | 3 +- .../Persistence/PetaPocoExtensionsTest.cs | 13 ++-- .../ContentRepositorySqlClausesTest.cs | 9 +-- .../ContentTypeRepositorySqlClausesTest.cs | 11 ++-- ...aTypeDefinitionRepositorySqlClausesTest.cs | 3 +- .../Persistence/Querying/ExpressionTests.cs | 15 ++--- .../Querying/MediaRepositorySqlClausesTest.cs | 3 +- .../MediaTypeRepositorySqlClausesTest.cs | 3 +- .../Persistence/Querying/PetaPocoSqlTests.cs | 13 ++-- .../Persistence/Querying/QueryBuilderTests.cs | 9 +-- .../Repositories/MemberRepositoryTest.cs | 3 +- .../MySqlSyntaxProviderTests.cs | 9 +-- .../SqlCeSyntaxProviderTests.cs | 9 +-- .../Services/ContentServicePerformanceTest.cs | 12 ++-- .../Services/ContentServiceTests.cs | 5 +- .../Services/PackagingServiceTests.cs | 3 +- .../Strings/DefaultShortStringHelperTests.cs | 5 +- .../Strings/StringExtensionsTests.cs | 5 +- src/Umbraco.Tests/unit-test-log4net.CI.config | 6 ++ 55 files changed, 218 insertions(+), 130 deletions(-) create mode 100644 src/Umbraco.Tests/unit-test-log4net.CI.config diff --git a/.gitignore b/.gitignore index a6c4639191..5b5e7660c5 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ apidocs/api/* build/docs.zip build/ui-docs.zip build/csharp-docs.zip +build/msbuild.log diff --git a/appveyor.yml b/appveyor.yml index db69da4978..a6641fb448 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,39 +8,36 @@ build_script: FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i" - SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% - - ECHO %PATH% - - - ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER% - - - SET nuGetFolder=%CD%\..\src\packages\ + SET nuGetFolder=C:\Users\appveyor\.nuget\packages ..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL ..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet - - IF EXIST ..\src\umbraco.businesslogic\packages.config ..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet + IF EXIST ..\src\umbraco.businesslogic\packages.config ..\src\.nuget\NuGet.exe install + + ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet ..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet - + ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER% + + SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% + SET MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe" - %MSBUILD% "../src/Umbraco.Tests/Umbraco.Tests.csproj" /verbosity:minimal - - - build.bat %release% build%APPVEYOR_BUILD_NUMBER% - + XCOPY "..\src\Umbraco.Tests\unit-test-log4net.CI.config" "..\src\Umbraco.Tests\unit-test-log4net.config" /Y + + %MSBUILD% "..\src\Umbraco.Tests\Umbraco.Tests.csproj" /consoleloggerparameters:Summary;ErrorsOnly + build.bat nopause %release% build%APPVEYOR_BUILD_NUMBER% + ECHO %PATH% test: assemblies: src\Umbraco.Tests\bin\Debug\Umbraco.Tests.dll artifacts: - path: build\UmbracoCms.* +- path: build\msbuild.log notifications: - provider: Slack auth_token: diff --git a/build/Build.bat b/build/Build.bat index 1167d9fcb6..fc0d8a69ea 100644 --- a/build/Build.bat +++ b/build/Build.bat @@ -11,20 +11,28 @@ FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SE FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i" REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version -IF [%1] NEQ [] (SET release=%1) -IF [%2] NEQ [] (SET comment=%2) ELSE (IF [%1] NEQ [] (SET "comment=")) +IF [%2] NEQ [] (SET release=%2) +IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment=")) + +REM Get the "is continuous integration" from the parameters +SET "isci=0" +IF [%1] NEQ [] (SET isci=1) SET version=%release% - IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%) + +ECHO. ECHO Building Umbraco %version% +ECHO. ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release% +ECHO. ECHO Removing the belle build folder and bower_components folder to make sure everything is clean as a whistle RD ..\src\Umbraco.Web.UI.Client\build /Q /S RD ..\src\Umbraco.Web.UI.Client\bower_components /Q /S +ECHO. ECHO Removing existing built files to make sure everything is clean as a whistle RMDIR /Q /S _BuildOutput DEL /F /Q UmbracoCms.*.zip @@ -32,27 +40,56 @@ DEL /F /Q UmbracoExamine.*.zip DEL /F /Q UmbracoCms.*.nupkg DEL /F /Q webpihash.txt +ECHO. ECHO Making sure Git is in the path so that the build can succeed CALL InstallGit.cmd -ECHO Performing MSBuild and producing Umbraco binaries zip files -%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /verbosity:minimal +REM Adding the default Git path so that if it's installed it can actually be found +REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git, +REM but the path setting is lost due to SETLOCAL +path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH% + +ECHO. +ECHO Making sure we have a web.config +IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config + +ECHO. +ECHO. +ECHO Performing MSBuild and producing Umbraco binaries zip files +ECHO This takes a few minutes and logging is set to report warnings +ECHO and errors only so it might seems like nothing is happening for a while. +ECHO You can check the msbuild.log file for progress. +ECHO. +%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger +IF ERRORLEVEL 1 GOTO :error + +ECHO. ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project attrib +h ..\src\Umbraco.Web.UI.Client\node_modules +ECHO. ECHO Adding Web.config transform files to the NuGet package REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform +ECHO. ECHO Packing the NuGet release files ..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet ..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet - -IF ERRORLEVEL 1 GOTO :showerror +IF ERRORLEVEL 1 GOTO :error -ECHO No errors were detected but you still may see some in the output, then it's time to investigate. -ECHO You might see some warnings but that is completely normal. +:success +ECHO. +ECHO No errors were detected! +ECHO There may still be some in the output, which you would need to investigate. +ECHO Warnings are usually normal. GOTO :EOF -:showerror -PAUSE +:error + +ECHO. +ECHO Errors were detected! + +REM don't pause if continuous integration else the build server waits forever +REM before cancelling the build (and, there is noone to read the output anyways) +IF isci NEQ 1 PAUSE diff --git a/build/InstallGit.cmd b/build/InstallGit.cmd index b6ba71df9b..26f8088f35 100644 --- a/build/InstallGit.cmd +++ b/build/InstallGit.cmd @@ -2,13 +2,13 @@ SETLOCAL REM SETLOCAL is on, so changes to the path not persist to the actual user's path -git.exe 2> NUL +git.exe --version if %ERRORLEVEL%==9009 GOTO :trydefaultpath GOTO :EOF :trydefaultpath path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH% -git.exe 2> NUL +git.exe --version if %ERRORLEVEL%==9009 GOTO :showerror GOTO :EOF diff --git a/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs b/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs index d28a8c44e9..bea89dea0f 100644 --- a/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/DeepCloneRuntimeCacheProviderTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Reflection; using System.Web; using NUnit.Framework; @@ -88,7 +89,7 @@ namespace Umbraco.Tests.Cache private static string GetValue(int i) { - Console.WriteLine("get" + i); + Debug.Print("get" + i); if (i < 3) throw new Exception("fail"); return "succ" + i; diff --git a/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs b/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs index 87e6d4366e..d1196b7d66 100644 --- a/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs +++ b/src/Umbraco.Tests/Cache/HttpRuntimeCacheProviderTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Web; using NUnit.Framework; using Umbraco.Core.Cache; @@ -49,7 +50,7 @@ namespace Umbraco.Tests.Cache private static string GetValue(int i) { - Console.WriteLine("get" + i); + Debug.Print("get" + i); if (i < 3) throw new Exception("fail"); return "succ" + i; diff --git a/src/Umbraco.Tests/CodeFirst/CodeFirstTests.cs b/src/Umbraco.Tests/CodeFirst/CodeFirstTests.cs index ee9080b094..c9550f89c1 100644 --- a/src/Umbraco.Tests/CodeFirst/CodeFirstTests.cs +++ b/src/Umbraco.Tests/CodeFirst/CodeFirstTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.IO; using System.Linq; using NUnit.Framework; @@ -60,7 +61,7 @@ namespace Umbraco.Tests.CodeFirst var result = SerializationService.ToStream(contentType.Value); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } [Test] @@ -91,7 +92,7 @@ namespace Umbraco.Tests.CodeFirst var result = SerializationService.ToStream(contentType.Value); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } [Test] diff --git a/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs b/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs index 08dbd89fca..5df7849430 100644 --- a/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs +++ b/src/Umbraco.Tests/CodeFirst/Definitions/ContentTypeDefinitionFactory.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Reflection; using Umbraco.Core; @@ -210,11 +211,11 @@ namespace Umbraco.Tests.CodeFirst.Definitions { var field = fields[sortOrder[i]]; list.Add(field.ContentType.Value); - Console.WriteLine(field.Alias); + Debug.Print(field.Alias); if (field.DependsOn != null) foreach (var item in field.DependsOn) { - Console.WriteLine(" -{0}", item); + Debug.Print(" -{0}", item); } } list.Reverse(); diff --git a/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs b/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs index 1e2302087b..5fe2efaa2c 100644 --- a/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs +++ b/src/Umbraco.Tests/CodeFirst/StronglyTypedMapperTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using System.Text.RegularExpressions; using NUnit.Framework; @@ -84,7 +85,7 @@ namespace Umbraco.Tests.CodeFirst }; var type = new AutoPublishedContentType(0, "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; - Console.WriteLine("INIT STRONG {0}", + Debug.Print("INIT STRONG {0}", PublishedContentType.Get(PublishedItemType.Content, "anything") .PropertyTypes.Count()); } diff --git a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs index 41414cb81a..bf5100815f 100644 --- a/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs +++ b/src/Umbraco.Tests/CoreXml/NavigableNavigatorTests.cs @@ -726,8 +726,8 @@ namespace Umbraco.Tests.CoreXml // but was NOT working (changing the order of nodes) with macro nav, debug // was due to an issue with macro nav IsSamePosition, fixed - //Console.WriteLine("--------"); - //Console.WriteLine(writer.ToString()); + //Debug.Print("--------"); + //Debug.Print(writer.ToString()); Assert.AreEqual(expected.Lf(), writer.ToString().Lf()); } diff --git a/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs b/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs index 33965c40c5..550310d164 100644 --- a/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs +++ b/src/Umbraco.Tests/DynamicsAndReflection/ExtensionMethodFinderTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; @@ -305,7 +306,7 @@ namespace Umbraco.Tests.DynamicsAndReflection var parameterType = parameters[i].ParameterType; var argumentType = arguments[i].GetType(); - Console.WriteLine("{0} / {1}", parameterType, argumentType); + Debug.Print("{0} / {1}", parameterType, argumentType); if (parameterType == argumentType) continue; // match if (parameterType.IsGenericParameter) // eg T @@ -334,7 +335,7 @@ namespace Umbraco.Tests.DynamicsAndReflection // then what ?! // should _variance_ be of some importance? - Console.WriteLine("generic {0}", argumentType.IsGenericType); + Debug.Print("generic {0}", argumentType.IsGenericType); } else { diff --git a/src/Umbraco.Tests/LibraryTests.cs b/src/Umbraco.Tests/LibraryTests.cs index dca6215d90..086395f456 100644 --- a/src/Umbraco.Tests/LibraryTests.cs +++ b/src/Umbraco.Tests/LibraryTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Text; @@ -44,7 +45,7 @@ namespace Umbraco.Tests }; var type = new AutoPublishedContentType(0, "anything", propertyTypes); PublishedContentType.GetPublishedContentTypeCallback = (alias) => type; - Console.WriteLine("INIT LIB {0}", + Debug.Print("INIT LIB {0}", PublishedContentType.Get(PublishedItemType.Content, "anything") .PropertyTypes.Count()); diff --git a/src/Umbraco.Tests/Logging/AsyncRollingFileAppenderTest.cs b/src/Umbraco.Tests/Logging/AsyncRollingFileAppenderTest.cs index ddd1c19095..c5e37f424a 100644 --- a/src/Umbraco.Tests/Logging/AsyncRollingFileAppenderTest.cs +++ b/src/Umbraco.Tests/Logging/AsyncRollingFileAppenderTest.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Threading; @@ -160,7 +161,7 @@ namespace Umbraco.Tests.Logging // Assert var logsPerSecond = logCount / testDuration.TotalSeconds; - Console.WriteLine("{0} messages logged in {1}s => {2}/s", logCount, testDuration.TotalSeconds, logsPerSecond); + Debug.Print("{0} messages logged in {1}s => {2}/s", logCount, testDuration.TotalSeconds, logsPerSecond); Assert.That(logsPerSecond, Is.GreaterThan(1000), "Must log at least 1000 messages per second"); } } diff --git a/src/Umbraco.Tests/Logging/ParallelForwarderTest.cs b/src/Umbraco.Tests/Logging/ParallelForwarderTest.cs index da5c58c0a9..88471ab650 100644 --- a/src/Umbraco.Tests/Logging/ParallelForwarderTest.cs +++ b/src/Umbraco.Tests/Logging/ParallelForwarderTest.cs @@ -120,7 +120,7 @@ namespace Umbraco.Tests.Logging // Assert Assert.That(debugAppender.LoggedEventCount, Is.EqualTo(0)); Assert.That(watch.ElapsedMilliseconds, Is.LessThan(testSize)); - Console.WriteLine("Logged {0} errors in {1}ms", testSize, watch.ElapsedMilliseconds); + Debug.Print("Logged {0} errors in {1}ms", testSize, watch.ElapsedMilliseconds); } [Test] @@ -171,7 +171,7 @@ namespace Umbraco.Tests.Logging //On some systems, we may not be able to flush all events prior to close, but it is reasonable to assume in this test case //that some events should be logged after close. Assert.That(numberLoggedAfterClose, Is.GreaterThan(numberLoggedBeforeClose), "Some number of LoggingEvents should be logged after close."); - Console.WriteLine("Flushed {0} events during shutdown", numberLoggedAfterClose - numberLoggedBeforeClose); + Debug.Print("Flushed {0} events during shutdown", numberLoggedAfterClose - numberLoggedBeforeClose); } [Test, Explicit("Long-running")] @@ -206,7 +206,7 @@ namespace Umbraco.Tests.Logging var events = debugAppender.GetEvents(); var evnt = events[events.Length - 1]; Assert.That(evnt.MessageObject, Is.EqualTo("The buffer was not able to be flushed before timeout occurred.")); - Console.WriteLine("Flushed {0} events during shutdown which lasted {1}ms", numberLoggedAfterClose - numberLoggedBeforeClose, watch.ElapsedMilliseconds); + Debug.Print("Flushed {0} events during shutdown which lasted {1}ms", numberLoggedAfterClose - numberLoggedBeforeClose, watch.ElapsedMilliseconds); } [Test] diff --git a/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs b/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs index 94e8802ca4..4e38f427e5 100644 --- a/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs +++ b/src/Umbraco.Tests/Migrations/AlterMigrationTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using Moq; using NUnit.Framework; @@ -45,11 +46,11 @@ namespace Umbraco.Tests.Migrations Assert.That(context.Expressions.Any(), Is.True); //Console output - Console.WriteLine("Number of expressions in context: {0}", context.Expressions.Count); - Console.WriteLine(""); + Debug.Print("Number of expressions in context: {0}", context.Expressions.Count); + Debug.Print(""); foreach (var expression in context.Expressions) { - Console.WriteLine(expression.ToString()); + Debug.Print(expression.ToString()); } } } diff --git a/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs b/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs index eb3c36ce42..6d49205adb 100644 --- a/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs +++ b/src/Umbraco.Tests/Migrations/FindingMigrationsTest.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using Moq; using NUnit.Framework; @@ -87,7 +88,7 @@ namespace Umbraco.Tests.Migrations //Console output foreach (var expression in context.Expressions) { - Console.WriteLine(expression.ToString()); + Debug.Print(expression.ToString()); } } diff --git a/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs b/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs index 872495dd7f..111837319d 100644 --- a/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs +++ b/src/Umbraco.Tests/Migrations/MigrationIssuesTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using Moq; using NUnit.Framework; @@ -96,7 +97,7 @@ namespace Umbraco.Tests.Migrations data = DatabaseContext.Database.Fetch("SELECT * FROM cmsPropertyData WHERE id=" + data.Id).FirstOrDefault(); Assert.IsNotNull(data); - Console.WriteLine(data.Text); + Debug.Print(data.Text); Assert.AreEqual("[{\"title\":\"\",\"caption\":\"\",\"link\":\"\",\"newWindow\":false,\"type\":\"external\",\"internal\":null,\"edit\":false,\"isInternal\":false}]", data.Text); } diff --git a/src/Umbraco.Tests/Migrations/TargetVersionSixthMigrationsTest.cs b/src/Umbraco.Tests/Migrations/TargetVersionSixthMigrationsTest.cs index 8d8682ecc5..5654abfda7 100644 --- a/src/Umbraco.Tests/Migrations/TargetVersionSixthMigrationsTest.cs +++ b/src/Umbraco.Tests/Migrations/TargetVersionSixthMigrationsTest.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Data.SqlServerCe; +using System.Diagnostics; using System.Linq; using System.Text.RegularExpressions; using Moq; @@ -89,7 +90,7 @@ namespace Umbraco.Tests.Migrations foreach (var expression in context.Expressions) { - Console.WriteLine(expression.ToString()); + Debug.Print(expression.ToString()); } Assert.That(migrations.Count(), Is.EqualTo(12)); diff --git a/src/Umbraco.Tests/Models/ContentTests.cs b/src/Umbraco.Tests/Models/ContentTests.cs index 6bc61649a5..4244188697 100644 --- a/src/Umbraco.Tests/Models/ContentTests.cs +++ b/src/Umbraco.Tests/Models/ContentTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; @@ -382,7 +383,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(content); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } /*[Test] diff --git a/src/Umbraco.Tests/Models/ContentTypeTests.cs b/src/Umbraco.Tests/Models/ContentTypeTests.cs index 0589d7d173..9d368ef886 100644 --- a/src/Umbraco.Tests/Models/ContentTypeTests.cs +++ b/src/Umbraco.Tests/Models/ContentTypeTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core; @@ -285,7 +286,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(contentType); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } [Test] @@ -390,7 +391,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(contentType); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } [Test] @@ -498,7 +499,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(contentType); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs b/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs index d066fbacaf..f5c37220fd 100644 --- a/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs +++ b/src/Umbraco.Tests/Models/DataTypeDefinitionTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -75,7 +76,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(dtd); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } diff --git a/src/Umbraco.Tests/Models/DictionaryItemTests.cs b/src/Umbraco.Tests/Models/DictionaryItemTests.cs index ff57b5eec6..ab60ccd709 100644 --- a/src/Umbraco.Tests/Models/DictionaryItemTests.cs +++ b/src/Umbraco.Tests/Models/DictionaryItemTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -130,7 +131,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs b/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs index 46d6ea1022..c69047d94e 100644 --- a/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs +++ b/src/Umbraco.Tests/Models/DictionaryTranslationTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -74,7 +75,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/LanguageTests.cs b/src/Umbraco.Tests/Models/LanguageTests.cs index 5d79364fb5..dc6b7bf989 100644 --- a/src/Umbraco.Tests/Models/LanguageTests.cs +++ b/src/Umbraco.Tests/Models/LanguageTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -56,7 +57,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/MemberGroupTests.cs b/src/Umbraco.Tests/Models/MemberGroupTests.cs index d39ddc93f3..ed208540ff 100644 --- a/src/Umbraco.Tests/Models/MemberGroupTests.cs +++ b/src/Umbraco.Tests/Models/MemberGroupTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -66,7 +67,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(group); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } diff --git a/src/Umbraco.Tests/Models/MemberTests.cs b/src/Umbraco.Tests/Models/MemberTests.cs index 62e3602232..ff1847d8ea 100644 --- a/src/Umbraco.Tests/Models/MemberTests.cs +++ b/src/Umbraco.Tests/Models/MemberTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -150,7 +151,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(member); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/PropertyGroupTests.cs b/src/Umbraco.Tests/Models/PropertyGroupTests.cs index ec345051ec..683b9b2adf 100644 --- a/src/Umbraco.Tests/Models/PropertyGroupTests.cs +++ b/src/Umbraco.Tests/Models/PropertyGroupTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -136,7 +137,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(pg); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/PropertyTypeTests.cs b/src/Umbraco.Tests/Models/PropertyTypeTests.cs index 96f28980ab..82c7521554 100644 --- a/src/Umbraco.Tests/Models/PropertyTypeTests.cs +++ b/src/Umbraco.Tests/Models/PropertyTypeTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -80,7 +81,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(pt); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } diff --git a/src/Umbraco.Tests/Models/RelationTests.cs b/src/Umbraco.Tests/Models/RelationTests.cs index fdc3ae874b..e1d218ef6e 100644 --- a/src/Umbraco.Tests/Models/RelationTests.cs +++ b/src/Umbraco.Tests/Models/RelationTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -65,7 +66,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/RelationTypeTests.cs b/src/Umbraco.Tests/Models/RelationTypeTests.cs index 2022ab912d..526dfdb3f6 100644 --- a/src/Umbraco.Tests/Models/RelationTypeTests.cs +++ b/src/Umbraco.Tests/Models/RelationTypeTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -59,7 +60,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/StylesheetTests.cs b/src/Umbraco.Tests/Models/StylesheetTests.cs index 24c0b64c88..ec6761e0e2 100644 --- a/src/Umbraco.Tests/Models/StylesheetTests.cs +++ b/src/Umbraco.Tests/Models/StylesheetTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -112,7 +113,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(stylesheet); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/TaskTests.cs b/src/Umbraco.Tests/Models/TaskTests.cs index 377746cbaf..54b62fcfa9 100644 --- a/src/Umbraco.Tests/Models/TaskTests.cs +++ b/src/Umbraco.Tests/Models/TaskTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -70,7 +71,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } diff --git a/src/Umbraco.Tests/Models/TaskTypeTests.cs b/src/Umbraco.Tests/Models/TaskTypeTests.cs index e83f8dc3cf..26d3a5d3dd 100644 --- a/src/Umbraco.Tests/Models/TaskTypeTests.cs +++ b/src/Umbraco.Tests/Models/TaskTypeTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -55,7 +56,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/TemplateTests.cs b/src/Umbraco.Tests/Models/TemplateTests.cs index a810d9420f..e279851b77 100644 --- a/src/Umbraco.Tests/Models/TemplateTests.cs +++ b/src/Umbraco.Tests/Models/TemplateTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using System.Reflection; using NUnit.Framework; @@ -75,7 +76,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } diff --git a/src/Umbraco.Tests/Models/UmbracoEntityTests.cs b/src/Umbraco.Tests/Models/UmbracoEntityTests.cs index 52513d551d..651e955f33 100644 --- a/src/Umbraco.Tests/Models/UmbracoEntityTests.cs +++ b/src/Umbraco.Tests/Models/UmbracoEntityTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Serialization; @@ -133,7 +134,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/UserTests.cs b/src/Umbraco.Tests/Models/UserTests.cs index c686a78dc8..189a4a17a8 100644 --- a/src/Umbraco.Tests/Models/UserTests.cs +++ b/src/Umbraco.Tests/Models/UserTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models.Membership; @@ -108,7 +109,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Models/UserTypeTests.cs b/src/Umbraco.Tests/Models/UserTypeTests.cs index 01e4d6fd89..72aa0b2efc 100644 --- a/src/Umbraco.Tests/Models/UserTypeTests.cs +++ b/src/Umbraco.Tests/Models/UserTypeTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models.Membership; @@ -54,7 +55,7 @@ namespace Umbraco.Tests.Models var result = ss.ToStream(item); var json = result.ResultStream.ToJsonString(); - Console.WriteLine(json); + Debug.Print(json); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs b/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs index d33148adc7..0a15994785 100644 --- a/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs +++ b/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text.RegularExpressions; using System.Threading; @@ -46,7 +47,7 @@ namespace Umbraco.Tests.Persistence double totalBytes1; IEnumerable keys; - Console.Write(Database.PocoData.PrintDebugCacheReport(out totalBytes1, out keys)); + Debug.Print(Database.PocoData.PrintDebugCacheReport(out totalBytes1, out keys)); result.Add(new Tuple>(totalBytes1, keys.Count(), keys)); } @@ -54,14 +55,14 @@ namespace Umbraco.Tests.Persistence for (int index = 0; index < result.Count; index++) { var tuple = result[index]; - Console.WriteLine("Bytes: {0}, Delegates: {1}", tuple.Item1, tuple.Item2); + Debug.Print("Bytes: {0}, Delegates: {1}", tuple.Item1, tuple.Item2); if (index != 0) { - Console.WriteLine("----------------DIFFERENCE---------------------"); + Debug.Print("----------------DIFFERENCE---------------------"); var diff = tuple.Item3.Except(result[index - 1].Item3); foreach (var d in diff) { - Console.WriteLine(d); + Debug.Print(d); } } @@ -87,13 +88,13 @@ namespace Umbraco.Tests.Persistence QueryStuff(id1, id2, id3, alias); var count1 = managedCache.GetCache().GetCount(); - Console.WriteLine("Keys = " + count1); + Debug.Print("Keys = " + count1); Assert.Greater(count1, 0); Thread.Sleep(10000); var count2 = managedCache.GetCache().GetCount(); - Console.WriteLine("Keys = " + count2); + Debug.Print("Keys = " + count2); Assert.Less(count2, count1); } diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs index 6e6d5251a8..e97b8ac92b 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentRepositorySqlClausesTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; @@ -42,7 +43,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -79,7 +80,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -120,7 +121,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -151,7 +152,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs index 5768f81242..8619692c52 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ContentTypeRepositorySqlClausesTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; @@ -43,7 +44,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -81,7 +82,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -103,7 +104,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -127,7 +128,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -157,7 +158,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs index 445b5b3e36..eede4adaa4 100644 --- a/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/DataTypeDefinitionRepositorySqlClausesTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; @@ -36,7 +37,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs b/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs index 2f6c903d14..ab94d4d6d5 100644 --- a/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/ExpressionTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq.Expressions; using Moq; using NUnit.Framework; @@ -23,7 +24,7 @@ namespace Umbraco.Tests.Persistence.Querying // var modelToSqlExpressionHelper = new ModelToSqlExpressionHelper(); // var result = modelToSqlExpressionHelper.Visit(predicate); - // Console.WriteLine("Model to Sql ExpressionHelper: \n" + result); + // Debug.Print("Model to Sql ExpressionHelper: \n" + result); // Assert.AreEqual("[cmsContentType].[alias] = @0", result); // Assert.AreEqual("Test", modelToSqlExpressionHelper.GetSqlParameters()[0]); @@ -37,7 +38,7 @@ namespace Umbraco.Tests.Persistence.Querying var modelToSqlExpressionHelper = new ModelToSqlExpressionHelper(); var result = modelToSqlExpressionHelper.Visit(predicate); - Console.WriteLine("Model to Sql ExpressionHelper: \n" + result); + Debug.Print("Model to Sql ExpressionHelper: \n" + result); Assert.AreEqual("upper([umbracoNode].[path]) LIKE upper(@0)", result); Assert.AreEqual("-1%", modelToSqlExpressionHelper.GetSqlParameters()[0]); @@ -51,7 +52,7 @@ namespace Umbraco.Tests.Persistence.Querying var modelToSqlExpressionHelper = new ModelToSqlExpressionHelper(); var result = modelToSqlExpressionHelper.Visit(predicate); - Console.WriteLine("Model to Sql ExpressionHelper: \n" + result); + Debug.Print("Model to Sql ExpressionHelper: \n" + result); Assert.AreEqual("([umbracoNode].[parentID] = @0)", result); Assert.AreEqual(-1, modelToSqlExpressionHelper.GetSqlParameters()[0]); @@ -64,7 +65,7 @@ namespace Umbraco.Tests.Persistence.Querying var modelToSqlExpressionHelper = new ModelToSqlExpressionHelper(); var result = modelToSqlExpressionHelper.Visit(predicate); - Console.WriteLine("Model to Sql ExpressionHelper: \n" + result); + Debug.Print("Model to Sql ExpressionHelper: \n" + result); Assert.AreEqual("([umbracoUser].[userLogin] = @0)", result); Assert.AreEqual("hello@world.com", modelToSqlExpressionHelper.GetSqlParameters()[0]); @@ -77,7 +78,7 @@ namespace Umbraco.Tests.Persistence.Querying var modelToSqlExpressionHelper = new ModelToSqlExpressionHelper(); var result = modelToSqlExpressionHelper.Visit(predicate); - Console.WriteLine("Model to Sql ExpressionHelper: \n" + result); + Debug.Print("Model to Sql ExpressionHelper: \n" + result); Assert.AreEqual("upper([umbracoUser].[userLogin]) = upper(@0)", result); Assert.AreEqual("hello@world.com", modelToSqlExpressionHelper.GetSqlParameters()[0]); @@ -93,7 +94,7 @@ namespace Umbraco.Tests.Persistence.Querying var modelToSqlExpressionHelper = new ModelToSqlExpressionHelper(); var result = modelToSqlExpressionHelper.Visit(predicate); - Console.WriteLine("Model to Sql ExpressionHelper: \n" + result); + Debug.Print("Model to Sql ExpressionHelper: \n" + result); Assert.AreEqual("upper(`umbracoUser`.`userLogin`) = upper(@0)", result); Assert.AreEqual("mydomain\\myuser", modelToSqlExpressionHelper.GetSqlParameters()[0]); @@ -110,7 +111,7 @@ namespace Umbraco.Tests.Persistence.Querying var modelToSqlExpressionHelper = new PocoToSqlExpressionHelper(); var result = modelToSqlExpressionHelper.Visit(predicate); - Console.WriteLine("Poco to Sql ExpressionHelper: \n" + result); + Debug.Print("Poco to Sql ExpressionHelper: \n" + result); Assert.AreEqual("upper(`umbracoUser`.`userLogin`) LIKE upper(@0)", result); Assert.AreEqual("mydomain\\myuser%", modelToSqlExpressionHelper.GetSqlParameters()[0]); diff --git a/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs index 57b2ef7503..37a12df6a3 100644 --- a/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/MediaRepositorySqlClausesTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; @@ -39,7 +40,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs b/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs index efed0e4e0f..bb417a6b94 100644 --- a/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs +++ b/src/Umbraco.Tests/Persistence/Querying/MediaTypeRepositorySqlClausesTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; @@ -36,7 +37,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(expected.Arguments[i], sql.Arguments[i]); } - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Querying/PetaPocoSqlTests.cs b/src/Umbraco.Tests/Persistence/Querying/PetaPocoSqlTests.cs index 7eed26c2d0..39f3f484d0 100644 --- a/src/Umbraco.Tests/Persistence/Querying/PetaPocoSqlTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/PetaPocoSqlTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; @@ -176,7 +177,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -195,7 +196,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -209,7 +210,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -223,7 +224,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -237,7 +238,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } [Test] @@ -257,7 +258,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.That(sql.SQL, Is.EqualTo(expected.SQL)); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs b/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs index dcc1b298a9..54b9a150f9 100644 --- a/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs +++ b/src/Umbraco.Tests/Persistence/Querying/QueryBuilderTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models; @@ -38,7 +39,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(1, result.Arguments.Length); Assert.AreEqual("-1%", sql.Arguments[0]); - Console.WriteLine(strResult); + Debug.Print(strResult); } [Test] @@ -65,7 +66,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(1, result.Arguments.Length); Assert.AreEqual(-1, sql.Arguments[0]); - Console.WriteLine(strResult); + Debug.Print(strResult); } [Test] @@ -91,7 +92,7 @@ namespace Umbraco.Tests.Persistence.Querying Assert.AreEqual(1, result.Arguments.Length); Assert.AreEqual("umbTextpage", sql.Arguments[0]); - Console.WriteLine(strResult); + Debug.Print(strResult); } [Test] @@ -121,7 +122,7 @@ namespace Umbraco.Tests.Persistence.Querying var strResult = result.SQL; // Assert - Console.WriteLine(strResult); + Debug.Print(strResult); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs index c8ffda7aec..bb13f055c9 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using System.Xml.Linq; using Moq; @@ -333,7 +334,7 @@ namespace Umbraco.Tests.Persistence.Repositories .OrderByDescending(x => x.VersionDate) .OrderBy(x => x.SortOrder); - Console.WriteLine(sql.SQL); + Debug.Print(sql.SQL); Assert.That(sql.SQL, Is.Not.Empty); } diff --git a/src/Umbraco.Tests/Persistence/SyntaxProvider/MySqlSyntaxProviderTests.cs b/src/Umbraco.Tests/Persistence/SyntaxProvider/MySqlSyntaxProviderTests.cs index 67c29581a4..8126aa5e36 100644 --- a/src/Umbraco.Tests/Persistence/SyntaxProvider/MySqlSyntaxProviderTests.cs +++ b/src/Umbraco.Tests/Persistence/SyntaxProvider/MySqlSyntaxProviderTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Linq; using Moq; using NUnit.Framework; @@ -34,16 +35,16 @@ namespace Umbraco.Tests.Persistence.SyntaxProvider var indexes = SqlSyntaxContext.SqlSyntaxProvider.Format(definition.Indexes); var keys = SqlSyntaxContext.SqlSyntaxProvider.Format(definition.ForeignKeys); - Console.WriteLine(create); - Console.WriteLine(primaryKey); + Debug.Print(create); + Debug.Print(primaryKey); foreach (var sql in keys) { - Console.WriteLine(sql); + Debug.Print(sql); } foreach (var sql in indexes) { - Console.WriteLine(sql); + Debug.Print(sql); } } diff --git a/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs b/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs index 2ec7688a6a..e960f50799 100644 --- a/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs +++ b/src/Umbraco.Tests/Persistence/SyntaxProvider/SqlCeSyntaxProviderTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.Models.Rdbms; @@ -57,16 +58,16 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine, var indexes = sqlSyntax.Format(definition.Indexes); var keys = sqlSyntax.Format(definition.ForeignKeys); - Console.WriteLine(create); - Console.WriteLine(primaryKey); + Debug.Print(create); + Debug.Print(primaryKey); foreach (var sql in keys) { - Console.WriteLine(sql); + Debug.Print(sql); } foreach (var sql in indexes) { - Console.WriteLine(sql); + Debug.Print(sql); } } diff --git a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs index 316d957a0c..9ae9519697 100644 --- a/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs +++ b/src/Umbraco.Tests/Services/ContentServicePerformanceTest.cs @@ -112,7 +112,7 @@ namespace Umbraco.Tests.Services watch.Stop(); var elapsed = watch.ElapsedMilliseconds; - Console.WriteLine("100 content items saved in {0} ms", elapsed); + Debug.Print("100 content items saved in {0} ms", elapsed); // Assert Assert.That(pages.Any(x => x.HasIdentity == false), Is.False); @@ -131,7 +131,7 @@ namespace Umbraco.Tests.Services watch.Stop(); var elapsed = watch.ElapsedMilliseconds; - Console.WriteLine("100 content items saved in {0} ms", elapsed); + Debug.Print("100 content items saved in {0} ms", elapsed); // Assert Assert.That(pages.Any(x => x.HasIdentity == false), Is.False); @@ -159,7 +159,7 @@ namespace Umbraco.Tests.Services watch.Stop(); var elapsed = watch.ElapsedMilliseconds; - Console.WriteLine("100 content items retrieved in {0} ms without caching", elapsed); + Debug.Print("100 content items retrieved in {0} ms without caching", elapsed); // Assert Assert.That(contents.Any(x => x.HasIdentity == false), Is.False); @@ -190,7 +190,7 @@ namespace Umbraco.Tests.Services watch.Stop(); var elapsed = watch.ElapsedMilliseconds; - Console.WriteLine("1000 content items retrieved in {0} ms without caching", elapsed); + Debug.Print("1000 content items retrieved in {0} ms without caching", elapsed); // Assert //Assert.That(contents.Any(x => x.HasIdentity == false), Is.False); @@ -223,7 +223,7 @@ namespace Umbraco.Tests.Services watch.Stop(); var elapsed = watch.ElapsedMilliseconds; - Console.WriteLine("100 content items retrieved in {0} ms with caching", elapsed); + Debug.Print("100 content items retrieved in {0} ms with caching", elapsed); // Assert Assert.That(contentsCached.Any(x => x.HasIdentity == false), Is.False); @@ -256,7 +256,7 @@ namespace Umbraco.Tests.Services watch.Stop(); var elapsed = watch.ElapsedMilliseconds; - Console.WriteLine("1000 content items retrieved in {0} ms with caching", elapsed); + Debug.Print("1000 content items retrieved in {0} ms with caching", elapsed); // Assert //Assert.That(contentsCached.Any(x => x.HasIdentity == false), Is.False); diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index 8d86e806a6..8a479c2d95 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Threading; using Moq; @@ -1587,7 +1588,7 @@ namespace Umbraco.Tests.Services list.Add(content); list.AddRange(CreateChildrenOf(contentType, content, 4)); - Console.WriteLine("Created: 'Hierarchy Simple Text Page {0}'", i); + Debug.Print("Created: 'Hierarchy Simple Text Page {0}'", i); } return list; @@ -1601,7 +1602,7 @@ namespace Umbraco.Tests.Services var c = MockedContent.CreateSimpleContent(contentType, "Hierarchy Simple Text Subpage " + i, content); list.Add(c); - Console.WriteLine("Created: 'Hierarchy Simple Text Subpage {0}' - Depth: {1}", i, depth); + Debug.Print("Created: 'Hierarchy Simple Text Subpage {0}' - Depth: {1}", i, depth); } return list; } diff --git a/src/Umbraco.Tests/Services/PackagingServiceTests.cs b/src/Umbraco.Tests/Services/PackagingServiceTests.cs index 72b1323e65..05ae7d0ad4 100644 --- a/src/Umbraco.Tests/Services/PackagingServiceTests.cs +++ b/src/Umbraco.Tests/Services/PackagingServiceTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Xml.Linq; @@ -42,7 +43,7 @@ namespace Umbraco.Tests.Services Assert.That(element, Is.Not.Null); Assert.That(element.Element("name").Value, Is.EqualTo("Test")); Assert.That(element.Element("alias").Value, Is.EqualTo("test1")); - Console.Write(element.ToString()); + Debug.Print(element.ToString()); } [Test] diff --git a/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs b/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs index ec7bbe3c72..58b0451995 100644 --- a/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs +++ b/src/Umbraco.Tests/Strings/DefaultShortStringHelperTests.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.Linq; using System.Text; @@ -369,9 +370,9 @@ namespace Umbraco.Tests.Strings // then next string element is one char and 3 bytes, 16 bits of code point Assert.AreEqual('t', bytes[9]); //foreach (var b in bytes) - // Console.WriteLine("{0:X}", b); + // Debug.Print("{0:X}", b); - Console.WriteLine("\U00010B70"); + Debug.Print("\U00010B70"); } [Test] diff --git a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs index 07ac002a48..199bd9254d 100644 --- a/src/Umbraco.Tests/Strings/StringExtensionsTests.cs +++ b/src/Umbraco.Tests/Strings/StringExtensionsTests.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using System.Globalization; using NUnit.Framework; using Umbraco.Core; @@ -31,8 +32,8 @@ namespace Umbraco.Tests.Strings [TestCase("hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello", "hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello", true)] public void String_To_Guid(string first, string second, bool result) { - Console.WriteLine("First: " + first.ToGuid()); - Console.WriteLine("Second: " + second.ToGuid()); + Debug.Print("First: " + first.ToGuid()); + Debug.Print("Second: " + second.ToGuid()); Assert.AreEqual(result, first.ToGuid() == second.ToGuid()); } diff --git a/src/Umbraco.Tests/unit-test-log4net.CI.config b/src/Umbraco.Tests/unit-test-log4net.CI.config new file mode 100644 index 0000000000..d7035032ef --- /dev/null +++ b/src/Umbraco.Tests/unit-test-log4net.CI.config @@ -0,0 +1,6 @@ + + + + + +