Not sure if this was a really good idea, but integrated StyleCop rules into the builds. Corrected all except documentation problems.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-02-04 23:52:21 +00:00
parent 30aa1b70bf
commit 224000c4c7
53 changed files with 2430 additions and 1575 deletions

View File

@@ -1,13 +1,15 @@
namespace UnitTestEightBit
// <copyright file="ChipUnitTest.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
namespace UnitTestEightBit
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using EightBit;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class ChipUnitTest
{
#region LowByte
[TestMethod]
public void TestLowByte()
{
@@ -16,10 +18,6 @@
Assert.AreEqual(0xf, low);
}
#endregion
#region HighByte
[TestMethod]
public void TestHighByte()
{
@@ -28,10 +26,6 @@
Assert.AreEqual(0xf0, high);
}
#endregion
#region ClearFlag
[TestMethod]
public void TestClearFlag()
{
@@ -72,10 +66,6 @@
Assert.AreEqual(0x7f, flags);
}
#endregion
#region SetFlag
[TestMethod]
public void TestSetFlag()
{
@@ -116,10 +106,6 @@
Assert.AreEqual(0xff, flags);
}
#endregion
#region LowerPart
[TestMethod]
public void TestLowerPart()
{
@@ -128,10 +114,6 @@
Assert.AreEqual(0xf, lower);
}
#endregion
#region HigherPart
[TestMethod]
public void TestHigherPart()
{
@@ -140,10 +122,6 @@
Assert.AreEqual(0xf000, higher);
}
#endregion
#region DemoteByte
[TestMethod]
public void TestDemoteByte()
{
@@ -152,10 +130,6 @@
Assert.AreEqual(0xf0, demoted);
}
#endregion
#region PromoteByte
[TestMethod]
public void TestPromoteByte()
{
@@ -164,10 +138,6 @@
Assert.AreEqual(0xf000, promoted);
}
#endregion
#region LowNibble
[TestMethod]
public void TestLowNibble()
{
@@ -176,10 +146,6 @@
Assert.AreEqual(0xb, nibble);
}
#endregion
#region HighNibble
[TestMethod]
public void TestHighNibble()
{
@@ -188,10 +154,6 @@
Assert.AreEqual(0xa, nibble);
}
#endregion
#region DemoteNibble
[TestMethod]
public void TestDemoteNibble()
{
@@ -200,10 +162,6 @@
Assert.AreEqual(0xa, nibble);
}
#endregion
#region PromoteNibble
[TestMethod]
public void TestPromoteNibble()
{
@@ -212,10 +170,6 @@
Assert.AreEqual(0xb0, nibble);
}
#endregion
#region HigherNibble
[TestMethod]
public void TestHigherNibble()
{
@@ -224,10 +178,6 @@
Assert.AreEqual(0xa0, nibble);
}
#endregion
#region LowerNibble
[TestMethod]
public void TestLowerNibble()
{
@@ -236,18 +186,11 @@
Assert.AreEqual(0xb, nibble);
}
#endregion
#region MakeWord
[TestMethod]
public void TestMakeWord()
{
ushort word = Chip.MakeWord(0xcd, 0xab);
Assert.AreEqual(0xabcd, word);
}
#endregion
}
}

View File

@@ -1,5 +1,8 @@
// <copyright file="AssemblyInfo.cs" company="Adrian Conlon">
// Copyright (c) Adrian Conlon. All rights reserved.
// </copyright>
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("UnitTestEightBit")]

View File

@@ -56,6 +56,7 @@
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EightBit\EightBit.csproj">
@@ -63,6 +64,10 @@
<Name>EightBit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.61\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.Unstable.1.1.1.61\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@@ -2,4 +2,6 @@
<packages>
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
<package id="StyleCop.Analyzers" version="1.1.1-beta.61" targetFramework="net472" developmentDependency="true" />
<package id="StyleCop.Analyzers.Unstable" version="1.1.1.61" targetFramework="net472" developmentDependency="true" />
</packages>

View File

@@ -0,0 +1,19 @@
{
// ACTION REQUIRED: This file was automatically added to your project, but it
// will not take effect until additional steps are taken to enable it. See the
// following page for additional information:
//
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/EnableConfiguration.md
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
"documentInterfaces": false,
"documentExposedElements": false,
"documentInternalElements": false,
"documentPrivateElements": false,
"documentPrivateFields": false,
"companyName": "Adrian Conlon"
}
}
}