Skip to content

Commit eb417b7

Browse files
committed
Adding in tests for Static Analyzer
1 parent 529e45a commit eb417b7

File tree

7 files changed

+566
-1
lines changed

7 files changed

+566
-1
lines changed

AzurePowershell.Test.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
<AsmXUnitTests Include=".\src\ServiceManagement\Network\Commands.Network.Test\bin\Debug\Microsoft.WindowsAzure.Commands.ServiceManagement.Network.Test.dll"/>
6767
</ItemGroup>
6868
<ItemGroup Condition=" '$(scope)' == 'all' ">
69+
<XUnitTests Include=".\tools\StaticAnalysis\StaticAnalysis.Test\bin\Debug\StaticAnalysis.Test.dll"/>
6970
<XUnitTests Include=".\src\ResourceManager\SiteRecovery\Commands.SiteRecovery.Test\bin\Debug\Microsoft.Azure.Commands.SiteRecovery.Test.dll"/>
7071
<XUnitTests Include=".\src\ResourceManager\Sql\Commands.Sql.Test\bin\Debug\Microsoft.Azure.Commands.Sql.Test.dll"/>
7172
<XUnitTests Include=".\src\ResourceManager\Resources\Commands.Resources.Test\bin\Debug\Microsoft.Azure.Commands.Resources.Test.dll"/>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+

2+
// ----------------------------------------------------------------------------------
3+
//
4+
// Copyright Microsoft Corporation
5+
// Licensed under the Apache License, Version 2.0 (the "License");
6+
// you may not use this file except in compliance with the License.
7+
// You may obtain a copy of the License at
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
// ----------------------------------------------------------------------------------
15+
16+
namespace StaticAnalysis.Test
17+
{
18+
public class Category
19+
{
20+
// Service
21+
public const string Service = "Service";
22+
23+
public const string All = "All";
24+
25+
// Owners
26+
public const string OneSDK = "OneSDK";
27+
28+
// Acceptance type
29+
public const string AcceptanceType = "AcceptanceType";
30+
31+
public const string CIT = "CIT";
32+
33+
public const string BVT = "BVT";
34+
35+
public const string CheckIn = "CheckIn";
36+
37+
// Run Type
38+
public const string RunType = "RunType";
39+
public const string LiveOnly = "LiveOnly";
40+
}
41+
}

tools/StaticAnalysis/StaticAnalysis.Test/MatchingTests.cs

Lines changed: 374 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("StaticAnalysis.Test")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("StaticAnalysis.Test")]
13+
[assembly: AssemblyCopyright("Copyright © 2016")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("f74b11e2-939c-4a80-a325-9d88d0171861")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" />
4+
<Import Project="..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" />
5+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
6+
<PropertyGroup>
7+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9+
<ProjectGuid>{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F}</ProjectGuid>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>StaticAnalysis.Test</RootNamespace>
13+
<AssemblyName>StaticAnalysis.Test</AssemblyName>
14+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
15+
<FileAlignment>512</FileAlignment>
16+
<NuGetPackageImportStamp>ba98ab34</NuGetPackageImportStamp>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<DebugSymbols>true</DebugSymbols>
20+
<DebugType>full</DebugType>
21+
<Optimize>false</Optimize>
22+
<OutputPath>bin\Debug\</OutputPath>
23+
<DefineConstants>DEBUG;TRACE</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Xml" />
43+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
44+
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
45+
<Private>True</Private>
46+
</Reference>
47+
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
48+
<HintPath>..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
49+
<Private>True</Private>
50+
</Reference>
51+
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
52+
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
53+
<Private>True</Private>
54+
</Reference>
55+
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
56+
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
57+
<Private>True</Private>
58+
</Reference>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Compile Include="Constants.cs" />
62+
<Compile Include="MatchingTests.cs" />
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<ProjectReference Include="..\StaticAnalysis.csproj">
67+
<Project>{68384b59-ba0c-4b7b-b3f6-9c7988296c16}</Project>
68+
<Name>StaticAnalysis</Name>
69+
</ProjectReference>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<None Include="packages.config" />
73+
</ItemGroup>
74+
<ItemGroup>
75+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
76+
</ItemGroup>
77+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
78+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
79+
<PropertyGroup>
80+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
81+
</PropertyGroup>
82+
<Error Condition="!Exists('..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props'))" />
83+
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.1.0\build\net20\xunit.runner.visualstudio.props'))" />
84+
</Target>
85+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
86+
Other similar extension points exist, see Microsoft.Common.targets.
87+
<Target Name="BeforeBuild">
88+
</Target>
89+
<Target Name="AfterBuild">
90+
</Target>
91+
-->
92+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="xunit" version="2.1.0" targetFramework="net45" />
4+
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
5+
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
6+
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
7+
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
8+
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
9+
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" />
10+
</packages>

tools/StaticAnalysis/StaticAnalysis.sln

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 2013
44
VisualStudioVersion = 12.0.40629.0
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Static Analysis", "StaticAnalysis.csproj", "{68384B59-BA0C-4B7B-B3F6-9C7988296C16}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticAnalysis", "StaticAnalysis.csproj", "{68384B59-BA0C-4B7B-B3F6-9C7988296C16}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{865C472B-4679-4B71-AA4B-B85283F3475D}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StaticAnalysis.Test", "StaticAnalysis.Test\StaticAnalysis.Test.csproj", "{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F}"
711
EndProject
812
Global
913
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,8 +19,15 @@ Global
1519
{68384B59-BA0C-4B7B-B3F6-9C7988296C16}.Debug|Any CPU.Build.0 = Debug|Any CPU
1620
{68384B59-BA0C-4B7B-B3F6-9C7988296C16}.Release|Any CPU.ActiveCfg = Release|Any CPU
1721
{68384B59-BA0C-4B7B-B3F6-9C7988296C16}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23+
{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F}.Debug|Any CPU.Build.0 = Debug|Any CPU
24+
{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F}.Release|Any CPU.ActiveCfg = Release|Any CPU
25+
{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F}.Release|Any CPU.Build.0 = Release|Any CPU
1826
EndGlobalSection
1927
GlobalSection(SolutionProperties) = preSolution
2028
HideSolutionNode = FALSE
2129
EndGlobalSection
30+
GlobalSection(NestedProjects) = preSolution
31+
{A034BE7F-0CD8-4A03-85B3-44CC2E58B86F} = {865C472B-4679-4B71-AA4B-B85283F3475D}
32+
EndGlobalSection
2233
EndGlobal

0 commit comments

Comments
 (0)