Skip to content

Commit 632341c

Browse files
committed
add code coverage and unit test execution
1 parent 2639cce commit 632341c

9 files changed

Lines changed: 21 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,4 @@ artifacts/
215215
#CodeCoverage
216216
**/CodeCoverage/*
217217
docs/
218+
/Tocsoft.DateTimeAbstractions.Coverage.xml

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ before_build:
1010

1111
build_script:
1212
- cmd: build.cmd
13-
# - cmd: tests\CodeCoverage\CodeCoverage.cmd
13+
- cmd: tests\CodeCoverage\CodeCoverage.cmd
1414

1515
after_build:
1616
- cmd: appveyor PushArtifact "artifacts\Tocsoft.DateTimeAbstractions.%GitVersion_NuGetVersion%.nupkg"

src/Tocsoft.DateTimeAbstractions.Analyzer/DateTimeOffsetUsageAnalyzer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
namespace Tocsoft.DateTimeAbstractions.Analyzer
1616
{
17-
1817
[DiagnosticAnalyzer(LanguageNames.CSharp)]
1918
public class DateTimeOffsetUsageAnalyzer : DiagnosticAnalyzer
2019
{

src/Tocsoft.DateTimeAbstractions.Analyzer/DateTimeOffsetUsageCodeFixProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
namespace Tocsoft.DateTimeAbstractions.Analyzer
1717
{
18-
1918
[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(DateTimeUsageCodeFixProvider))]
2019
[Shared]
2120
public class DateTimeOffsetUsageCodeFixProvider : CodeFixProvider

src/Tocsoft.DateTimeAbstractions.Analyzer/Tocsoft.DateTimeAbstractions.Analyzer.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44
<TargetFramework>netstandard1.3</TargetFramework>
55
<IncludeBuildOutput>false</IncludeBuildOutput>
66
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
7+
<DebugType Condition="$(codecov) != ''">full</DebugType>
8+
<DebugType Condition="$(codecov) == ''">portable</DebugType>
9+
<DebugSymbols>True</DebugSymbols>
10+
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
11+
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
712
</PropertyGroup>
813

914
<PropertyGroup>
1015
<PackageId>Tocsoft.DateTimeAbstractions.Analyzer</PackageId>
11-
<PackageVersion>1.0.0.0</PackageVersion>
1216
<Authors>Tocsoft</Authors>
1317
<PackageLicenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</PackageLicenseUrl>
1418
<PackageProjectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</PackageProjectUrl>

src/Tocsoft.DateTimeAbstractions/ImmutableStack{T}.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Tocsoft.DateTimeAbstractions
1010
{
1111
internal class ImmutableStack<T>
1212
{
13-
private static readonly ImmutableStack<T> emptyField = new ImmutableStack<T>();
13+
private static readonly ImmutableStack<T> EmptyField = new ImmutableStack<T>();
1414
private T head;
1515
private ImmutableStack<T> tail;
1616

@@ -40,13 +40,14 @@ public static ImmutableStack<T> Empty
4040
{
4141
get
4242
{
43-
return emptyField;
43+
return EmptyField;
4444
}
4545
}
4646

4747
/// <summary>
4848
/// Gets the empty stack, upon which all stacks are built.
4949
/// </summary>
50+
/// <returns>Returns an empty ImmutableStack</returns>
5051
public ImmutableStack<T> Clear()
5152
{
5253
return Empty;

src/Tocsoft.DateTimeAbstractions/Tocsoft.DateTimeAbstractions.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7+
<DebugType Condition="$(codecov) != ''">full</DebugType>
8+
<DebugType Condition="$(codecov) == ''">portable</DebugType>
9+
<DebugSymbols>True</DebugSymbols>
10+
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
11+
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
712
</PropertyGroup>
813

914
<ItemGroup>
@@ -18,7 +23,6 @@
1823

1924
<PropertyGroup>
2025
<AnlyzersOutputDir>..\Tocsoft.DateTimeAbstractions.Analyzer\bin\$(Configuration)\netstandard1.3</AnlyzersOutputDir>
21-
<Version>1.0.0</Version>
2226
<Authors>Tocsoft</Authors>
2327
<Company />
2428
<Product>DateTimeAbstractions</Product>

tests/Tocsoft.DateTimeAbstractions.Tests/DateTimeOffsetAsyncScoppedClock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private Task RunTestForceThread(int count)
5858

5959
private async Task RunTest(int count)
6060
{
61-
DateTimeOffset date = new DateTimeOffset(2000, 01, 01, 12,12,12, TimeSpan.FromHours(2));
61+
DateTimeOffset date = new DateTimeOffset(2000, 01, 01, 12, 12, 12, TimeSpan.FromHours(2));
6262
date = date.AddDays(count);
6363
using (ClockOffset.Pin(date))
6464
{

tests/Tocsoft.DateTimeAbstractions.Tests/Tocsoft.DateTimeAbstractions.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<ApplicationIcon />
66
<OutputType>Exe</OutputType>
77
<StartupObject />
8+
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
9+
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
10+
<DebugType Condition="$(codecov) != ''">full</DebugType>
11+
<DebugType Condition="$(codecov) == ''">portable</DebugType>
12+
<DebugSymbols>True</DebugSymbols>
813
</PropertyGroup>
914

1015
<ItemGroup>

0 commit comments

Comments
 (0)