Moved unit tests to right project + Cleanup + Write info in test console

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Bjarke Berg
2020-10-27 14:10:19 +01:00
parent a09e218501
commit 765140b7cd
11 changed files with 26 additions and 57 deletions

View File

@@ -76,15 +76,22 @@ namespace Umbraco.Tests.Integration.Testing
_testTeardown = null;
FirstTestInFixture = false;
FirstTestInSession = false;
}
[TearDown]
public virtual void TearDown_Logging()
{
TestContext.Progress.Write($" {TestContext.CurrentContext.Result.Outcome.Status}");
}
[SetUp]
public virtual void SetUp_Logging()
{
TestContext.Progress.Write($"Start test {TestCount++}: {TestContext.CurrentContext.Test.Name}");
}
[SetUp]
public virtual void Setup()
{
TestContext.Progress.Write($"Start test {_testCount++}: {TestContext.CurrentContext.Test.Name}");
var hostBuilder = CreateHostBuilder();
var host = hostBuilder.Start();
@@ -433,7 +440,7 @@ namespace Umbraco.Tests.Integration.Testing
#endregion
#region Common services
protected virtual T GetRequiredService<T>() => Services.GetRequiredService<T>();
public Dictionary<string, string> InMemoryConfiguration { get; } = new Dictionary<string, string>();
@@ -484,6 +491,6 @@ namespace Umbraco.Tests.Integration.Testing
protected static bool FirstTestInSession = true;
protected bool FirstTestInFixture = true;
private static int _testCount = 1;
protected static int TestCount = 1;
}
}

View File

@@ -1,4 +1,5 @@
using System;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
@@ -12,9 +13,8 @@ namespace Umbraco.Tests.Integration.Testing
protected IFileService FileService => GetRequiredService<IFileService>();
protected ContentService ContentService => (ContentService)GetRequiredService<IContentService>();
public override void Setup()
{
base.Setup();
[SetUp]
public void Setup(){
CreateTestData();
}