View TestsDynamicTestCases.cs
TestCase.AddTestCase("Telerik Platform Starter> Buy Telerik Platform");
XmlBillingInfo billingInfo = xmlInvoice.BillingInfo;
TestCase.AddActionStep("Type Billing First Name = {0}", billingInfo.FirstName);
billingInfoMap.BillingFirstName = billingInfo.FirstName;
TestCase.AddActionStep("Type Billing Last Name = {0}", billingInfo.LastName);
billingInfoMap.BillingLastName = billingInfo.LastName;
TestCase.AddActionStep("Type Billing Email = {0}", billingInfo.Email);
billingInfoMap.BillingEmail = billingInfo.Email;
TestCase.AddActionStep("Type Billing Company = {0}", billingInfo.CompanyName);
billingInfoMap.BillingCompany = billingInfo.CompanyName;
View usageOfStylecop.csproj
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<RunCodeAnalysis>True</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>$(SolutionDir)\StyleCopeRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
View stylecop.csproj
<ItemGroup>
<ExcludeFromStyleCop Include="**\*.cs" Condition=" '$(Configuration)' == 'Release' " />
<ItemGroup/>
View stylecop.csproj
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RunCodeAnalysis>True</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>$(SolutionDir)\StyleCopeRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
View stylecop.json
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"documentationRules": {
"companyName": "Automate The Planet Ltd.",
"copyrightText": "This source code is Copyright © {companyName} and MAY NOT be copied, reproduced,\npublished, distributed or transmitted to or stored in any manner without prior\nwritten consent from {companyName} (bellatrix.solutions).",
"documentExposedElements": "false",
"documentInternalElements": "false",
"documentPrivateElements": "false",
"documentPrivateFields": "false"
View StyleCopeRules.xml
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="StyleCopeRules" Description="StyleCopeRules custom ruleset" ToolsVersion="15.0">
<IncludeAll Action="Warning" />
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1108" Action="None" />
<Rule Id="SA1115" Action="None" />
<Rule Id="SA1116" Action="None" />
<Rule Id="SA1118" Action="None" />
<Rule Id="SA1123" Action="None" />
View SampleRulesCode.cs
// dotnet_style_object_initializer = false:error
var bigSpaceShip = new SpaceShip();
bigSpaceShip.Name = "Meissa";
View SampleRulesCode.cs
// dotnet_style_object_initializer = true:error
var bigSpaceShip = new SpaceShip
{
Name = "Meissa"
};
View SampleRulesCode.cs
// dotnet_style_null_propagation = false:error
var smallSpaceShip = spaceShipFactory == null ? null : spaceShipFactory.Build();
View SampleRulesCode.cs
// dotnet_style_null_propagation = true:error
var smallSpaceShip = spaceShipFactory?.Build();