-
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.
- Loading branch information
Showing
71 changed files
with
366 additions
and
382 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
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,18 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "<Pending>", Scope = "type", Target = "~T:GSendAnalyzer.Analyzers.AnalyzeM630_1RunParameters")] | ||
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "<Pending>", Scope = "type", Target = "~T:GSendAnalyzer.Analyzers.AnalyzeM631_2ReturnCode")] | ||
[assembly: SuppressMessage("Minor Code Smell", "S101:Types should be named in PascalCase", Justification = "<Pending>", Scope = "type", Target = "~T:GSendAnalyzer.Analyzers.AnalyzeM631_1RunParameters")] | ||
[assembly: SuppressMessage("Major Code Smell", "S2589:Boolean expressions should not be gratuitous", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.Internal.GCodeParser.ParseVariableBlockss(GSendAnalyzer.GCodeAnalyses,System.Collections.Generic.List{GSendShared.IGCodeVariableBlock},System.Int32,System.String)~System.Decimal")] | ||
[assembly: SuppressMessage("Major Code Smell", "S108:Nested blocks of code should not be left empty", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.Internal.GCodeParser.InternalParseGCode(GSendAnalyzer.GCodeAnalyses,System.Byte[],System.Int32)~GSendAnalyzer.GCodeAnalyses")] | ||
[assembly: SuppressMessage("Style", "IDE0063:Use simple 'using' statement", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.GCodeAnalyses.AllSpecificCommands(System.Char)~System.Collections.Generic.IReadOnlyList{GSendShared.IGCodeCommand}")] | ||
[assembly: SuppressMessage("Style", "IDE0063:Use simple 'using' statement", Justification = "<Pending>", Scope = "member", Target = "~P:GSendAnalyzer.GCodeAnalyses.AllCommands")] | ||
[assembly: SuppressMessage("Style", "IDE0063:Use simple 'using' statement", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.GCodeAnalyses.AddOptions(GSendShared.AnalysesOptions)")] | ||
[assembly: SuppressMessage("Style", "IDE0066:Convert switch statement to expression", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.Analyzers.AnalyzeM630RunProgram.ValidExtension(System.String)~System.Boolean")] | ||
[assembly: SuppressMessage("Style", "IDE0066:Convert switch statement to expression", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.Analyzers.AnalyzeM62XComPorts.IsComPortCommand(System.Decimal)~System.Boolean")] | ||
[assembly: SuppressMessage("Style", "IDE0066:Convert switch statement to expression", Justification = "<Pending>", Scope = "member", Target = "~M:GSendAnalyzer.Analyzers.AnalyzeCoordinateSystemsUsed.IsCoordCommand(System.Decimal)~System.Boolean")] |
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 |
---|---|---|
@@ -1,129 +1,66 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
using GSendService; | ||
|
||
using GSendTests.Mocks; | ||
|
||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
using Moq; | ||
|
||
using PluginManager.Abstractions; | ||
|
||
using SharedPluginFeatures; | ||
|
||
namespace GSendTests.GCService | ||
{ | ||
[TestClass] | ||
[ExcludeFromCodeCoverage] | ||
public class PluginInitializationTests | ||
{ | ||
//private const string TestsCategory = "Initialization Tests"; | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void ExtendsIPluginAndIInitialiseEvents() | ||
//{ | ||
// PluginInitialization sut = new PluginInitialization(); | ||
|
||
// Assert.IsInstanceOfType(sut, typeof(IPlugin)); | ||
// Assert.IsInstanceOfType(sut, typeof(IInitialiseEvents)); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void GetVersion_ReturnsCurrentVersion_Success() | ||
//{ | ||
// PluginInitialization sut = new PluginInitialization(); | ||
|
||
// Assert.AreEqual((ushort)1, sut.GetVersion()); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void Initialize_DoesNotAddItemsToLogger() | ||
//{ | ||
// PluginInitialization sut = new PluginInitialization(); | ||
// MockLogger testLogger = new MockLogger(); | ||
|
||
// sut.Initialise(testLogger); | ||
|
||
// Assert.AreEqual(0, testLogger.Logs.Count); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void AfterConfigure_DoesNotConfigurePipeline_Success() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
|
||
// sut.AfterConfigure(testApplicationBuilder); | ||
|
||
// Assert.IsFalse(testApplicationBuilder.UseCalled); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void Configure_DoesNotConfigurePipeline_Success() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
|
||
// sut.Configure(testApplicationBuilder); | ||
|
||
// Assert.IsFalse(testApplicationBuilder.UseCalled); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void BeforeConfigure_DoesRegisterApplicationServices() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
|
||
// sut.BeforeConfigure(testApplicationBuilder); | ||
|
||
// Assert.IsTrue(testApplicationBuilder.UseCalled); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void Configure_DoesNotRegisterApplicationServices() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
|
||
// sut.Configure(testApplicationBuilder); | ||
|
||
// Assert.IsFalse(testApplicationBuilder.UseCalled); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void Finalise_DoesNotThrowException() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
// Assert.IsNotNull(sut); | ||
|
||
// sut.Finalise(); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void BeforeConfigureServices_DoesNotThrowException() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
// MockServiceCollection mockServiceCollection = new MockServiceCollection(); | ||
|
||
// sut.BeforeConfigureServices(mockServiceCollection); | ||
|
||
// Assert.AreEqual(0, mockServiceCollection.ServicesRegistered); | ||
//} | ||
|
||
//[TestMethod] | ||
//[TestCategory(TestsCategory)] | ||
//public void ConfigureServices_DoesNotThrowException() | ||
//{ | ||
// MockApplicationBuilder testApplicationBuilder = new MockApplicationBuilder(); | ||
// PluginInitialization sut = new PluginInitialization(); | ||
// MockServiceCollection mockServiceCollection = new MockServiceCollection(); | ||
|
||
// sut.ConfigureServices(mockServiceCollection); | ||
|
||
// Assert.AreEqual(0, mockServiceCollection.ServicesRegistered); | ||
//} | ||
private const string TestsCategory = "Initialization Tests"; | ||
|
||
[TestMethod] | ||
[TestCategory(TestsCategory)] | ||
public void ExtendsIPluginAndIInitialiseEvents() | ||
{ | ||
PluginInitialization sut = new PluginInitialization(); | ||
|
||
Assert.IsInstanceOfType(sut, typeof(IPlugin)); | ||
Assert.IsInstanceOfType(sut, typeof(IInitialiseEvents)); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory(TestsCategory)] | ||
public void GetVersion_ReturnsCurrentVersion_Success() | ||
{ | ||
PluginInitialization sut = new PluginInitialization(); | ||
|
||
Assert.AreEqual((ushort)1, sut.GetVersion()); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory(TestsCategory)] | ||
public void Initialize_DoesNotAddItemsToLogger() | ||
{ | ||
PluginInitialization sut = new PluginInitialization(); | ||
MockLogger testLogger = new MockLogger(); | ||
|
||
sut.Initialise(testLogger); | ||
|
||
Assert.AreEqual(0, testLogger.LogItems.Count); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory(TestsCategory)] | ||
public void Finalise_DoesNotThrowException() | ||
{ | ||
PluginInitialization sut = new PluginInitialization(); | ||
Assert.IsNotNull(sut); | ||
|
||
sut.Finalise(); | ||
} | ||
} | ||
} |
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.