Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Updated changes from master
Browse files Browse the repository at this point in the history
  • Loading branch information
unickq committed May 16, 2021
1 parent 7ce44f7 commit 21b8bac
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 29 deletions.
20 changes: 16 additions & 4 deletions src/allure-nunit/Attributes/AllureDescriptionAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
using System;
using NUnit.Framework;
using Allure.Commons;

namespace NUnit.Allure.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class AllureDescriptionAttribute : NUnitAttribute
public class AllureDescriptionAttribute : AllureTestCaseAttribute
{
public AllureDescriptionAttribute(string description, bool html = false)
{
TestDescription = description;
IsHtml = html;
}

internal string TestDescription { get; }
internal bool IsHtml { get; }
private string TestDescription { get; }
private bool IsHtml { get; }

public override void UpdateTestResult(TestResult testResult)
{
if (IsHtml)
{
testResult.descriptionHtml += TestDescription;
}
else
{
testResult.description += TestDescription;
}
}
}
}
8 changes: 5 additions & 3 deletions src/allure-nunit/Attributes/AllureDisplayIgnoredAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ public void AfterTest(ITest suite)
}
}

private static IEnumerable<ITest> GetAllTests(ITest test) =>
test.Tests.Concat(test.Tests.SelectMany(GetAllTests));

public ActionTargets Targets => ActionTargets.Suite;

private static IEnumerable<ITest> GetAllTests(ITest test)
{
return test.Tests.Concat(test.Tests.SelectMany(GetAllTests));
}
}
}
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureEpicAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureEpicAttribute(string epic)
Epic = epic;
}

public string Epic { get; }
private string Epic { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureFeatureAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureFeatureAttribute(params string[] feature)
Features = feature;
}

internal string[] Features { get; }
private string[] Features { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureIssueAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public AllureIssueAttribute(string name)
IssueLink = new Link {name = name, type = "issue", url = name};
}

internal Link IssueLink { get; }
private Link IssueLink { get; }

public override void UpdateTestResult(TestResult testCaseResult)
{
Expand Down
6 changes: 3 additions & 3 deletions src/allure-nunit/Attributes/AllureLabelAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public AllureLabelAttribute(string name, string value)
Value = value;
}

internal string Name { get; }
internal string Value { get; }
private string Name { get; }
private string Value { get; }

public override void UpdateTestResult(TestResult testResult)
{
testResult.labels.Add(new Label { name = Name, value = Value });
testResult.labels.Add(new Label {name = Name, value = Value});
}
}
}
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureLinkAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public AllureLinkAttribute(string url)
Link = new Link {name = url, type = "link", url = url};
}

internal Link Link { get; }
private Link Link { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
11 changes: 8 additions & 3 deletions src/allure-nunit/Attributes/AllureNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
using System;
using NUnit.Framework;
using Allure.Commons;

namespace NUnit.Allure.Attributes
{
[AttributeUsage(AttributeTargets.Method)]
public class AllureNameAttribute : NUnitAttribute
public class AllureNameAttribute : AllureTestCaseAttribute
{
public AllureNameAttribute(string name)
{
TestName = name;
}

internal string TestName { get; }
private string TestName { get; }

public override void UpdateTestResult(TestResult testResult)
{
testResult.name = TestName;
}
}
}
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureOwnerAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureOwnerAttribute(string owner)
Owner = owner;
}

internal string Owner { get; }
private string Owner { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureParentSuiteAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureParentSuiteAttribute(string parentSuite)
ParentSuite = parentSuite;
}

internal string ParentSuite { get; }
private string ParentSuite { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureSeverityAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureSeverityAttribute(SeverityLevel severity = SeverityLevel.normal)
Severity = severity;
}

internal SeverityLevel Severity { get; }
private SeverityLevel Severity { get; }

public override void UpdateTestResult(TestResult testCaseResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureStoryAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureStoryAttribute(params string[] story)
Stories = story;
}

internal string[] Stories { get; }
private string[] Stories { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureSubSuiteAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureSubSuiteAttribute(string subSuite)
SubSuite = subSuite;
}

internal string SubSuite { get; }
private string SubSuite { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureSuiteAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureSuiteAttribute(string suite)
Suite = suite;
}

internal string Suite { get; }
private string Suite { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureTagAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public AllureTagAttribute(params string[] tags)
Tags = tags;
}

internal string[] Tags { get; }
private string[] Tags { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureTestCaseAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ public abstract class AllureTestCaseAttribute : NUnitAttribute
{
public abstract void UpdateTestResult(TestResult testResult);
}
}
}
2 changes: 1 addition & 1 deletion src/allure-nunit/Attributes/AllureTmsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public AllureTmsAttribute(string name)
TmsLink = new Link {name = name, type = "tms", url = name};
}

internal Link TmsLink { get; }
private Link TmsLink { get; }

public override void UpdateTestResult(TestResult testResult)
{
Expand Down
6 changes: 3 additions & 3 deletions src/allure-nunit/allure-nunit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyVersion>1.0.14-beta2</AssemblyVersion>
<FileVersion>1.0.14-beta2</FileVersion>
<Version>1.0.14-beta2</Version>
<AssemblyVersion>1.0.14-beta3</AssemblyVersion>
<FileVersion>1.0.14-beta3</FileVersion>
<Version>1.0.14-beta3</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Authors>Nick Chursin</Authors>
<Description>NUnit attributes extenstions for Allure</Description>
Expand Down

0 comments on commit 21b8bac

Please sign in to comment.