-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#67 First pass at pulling coverage numbers up
Moderate progress on pulling the coverage up for modules - prop & camera will be the two big ones. Might need to check the melody player & associated bits. Also covered the core logger.
- Loading branch information
Showing
15 changed files
with
282 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,23 @@ jobs: | |
- name: Build | ||
run: dotnet build --no-restore | ||
- name: Test | ||
run: dotnet test --no-build --verbosity normal | ||
run: dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | ||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage/**/coverage.cobertura.xml | ||
badge: true | ||
fail_below_min: true | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '33 66' | ||
|
||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using skullOS.Core; | ||
using skullOS.Core.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Moq; | ||
|
||
namespace CoreTests | ||
{ | ||
public class LoggerTest | ||
{ | ||
ISkullLogger SkullLogger; | ||
|
||
public LoggerTest() | ||
{ | ||
FileManager.CreateSkullDirectory(isTest: true); | ||
SkullLogger = new SkullLogger(); | ||
} | ||
|
||
[Fact] | ||
public void CanCreateLogger() | ||
{ | ||
Assert.NotNull(SkullLogger); | ||
} | ||
|
||
[Fact] | ||
public void LogIsLocatable() | ||
{ | ||
Assert.Equal(It.IsAny<string>(), SkullLogger.GetLogLocation()); | ||
} | ||
|
||
[Fact] | ||
public void CanAddToLog() | ||
{ | ||
var logContentsBefore = File.ReadAllText(SkullLogger.GetLogLocation()); | ||
SkullLogger.LogMessage("FooBar!"); | ||
var logContentsAfter = File.ReadAllText(SkullLogger.GetLogLocation()); | ||
|
||
Assert.NotEqual(logContentsBefore, logContentsAfter); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Moq; | ||
using skullOS.Modules; | ||
using skullOS.Modules.Exceptions; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ModuleTests | ||
{ | ||
public class DownlinkTest | ||
{ | ||
Downlink Downlink; | ||
|
||
public DownlinkTest() | ||
{ | ||
Downlink = new Downlink(); | ||
} | ||
|
||
[Fact] | ||
public void CreateThrowsException() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => Downlink.Create()); | ||
} | ||
|
||
[Fact] | ||
public void OnActionThrowsException() | ||
{ | ||
Assert.Throws<OnActionException>(() => | ||
Downlink.OnAction(It.IsAny<object>(), It.IsAny<EventArgs>())); | ||
} | ||
|
||
[Fact] | ||
public void OnEnableThrowsException() | ||
{ | ||
Assert.Throws<OnEnableException>(() => Downlink.OnEnable(It.IsAny<string[]>())); | ||
} | ||
|
||
[Fact] | ||
public void OnStringThrowsException() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => Downlink.ToString()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Moq; | ||
using skullOS.Modules; | ||
using skullOS.Modules.Exceptions; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ModuleTests | ||
{ | ||
public class QrCodeReaderTest | ||
{ | ||
QrCodeReader codeReader; | ||
|
||
public QrCodeReaderTest() | ||
{ | ||
codeReader = new QrCodeReader(); | ||
} | ||
|
||
[Fact] | ||
public void CreateThrowsException() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => codeReader.Create()); | ||
} | ||
|
||
[Fact] | ||
public void OnActionThrowsException() | ||
{ | ||
Assert.Throws<OnActionException>(() => | ||
codeReader.OnAction(It.IsAny<object>(), It.IsAny<EventArgs>())); | ||
} | ||
|
||
[Fact] | ||
public void OnEnableThrowsException() | ||
{ | ||
Assert.Throws<OnEnableException>(() => codeReader.OnEnable(It.IsAny<string[]>())); | ||
} | ||
|
||
[Fact] | ||
public void OnStringThrowsException() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => codeReader.ToString()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using Moq; | ||
using skullOS.Modules; | ||
using skullOS.Modules.Exceptions; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ModuleTests | ||
{ | ||
public class UplinkTest | ||
{ | ||
Uplink Uplink; | ||
|
||
public UplinkTest() | ||
{ | ||
Uplink = new Uplink(); | ||
} | ||
|
||
[Fact] | ||
public void CreateThrowsException() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => Uplink.Create()); | ||
} | ||
|
||
[Fact] | ||
public void OnActionThrowsException() | ||
{ | ||
Assert.Throws<OnActionException>(() => | ||
Uplink.OnAction(It.IsAny<object>(), It.IsAny<EventArgs>())); | ||
} | ||
|
||
[Fact] | ||
public void OnEnableThrowsException() | ||
{ | ||
Assert.Throws<OnEnableException>(() => Uplink.OnEnable(It.IsAny<string[]>())); | ||
} | ||
|
||
[Fact] | ||
public void OnStringThrowsException() | ||
{ | ||
Assert.Throws<NotImplementedException>(() => Uplink.ToString()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
{ | ||
public interface ISkullLogger | ||
{ | ||
string GetLogLocation(); | ||
void LogMessage(string message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.