Skip to content

Commit 871aeb3

Browse files
committed
Fix package working
will be removed referenced package System.IO.Abstractions will be replaced System.IO.Abstractions classes on string path
1 parent 32a31b8 commit 871aeb3

21 files changed

Lines changed: 147 additions & 71 deletions

System.IO.Abstractions.Analyzers.Tests/Analyzers/DriveInfoAnalyzerTests.cs renamed to System.IO.Abstractions.Analyzers.Tests/Analyzers/StringReaderAnalyzerTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace System.IO.Abstractions.Analyzers.Tests.Analyzers
99
{
10-
public class DriveInfoAnalyzerTests: CSharpDiagnosticAnalyzerTest<DriveInfoAnalyzer>
10+
public class StringReaderAnalyzerTests : CSharpDiagnosticAnalyzerTest<StringReaderAnalyzer>
1111
{
1212
[Theory]
1313
[InlineData("Valid.txt")]
@@ -18,16 +18,15 @@ public void Analyzer_is_not_triggered(string filename)
1818
}
1919

2020
[Theory]
21-
[InlineData("WithOutFileSystem.txt", 15, 21)]
22-
[InlineData("StaticInvocation.txt", 15, 25)]
21+
[InlineData("WithOutFileSystem.txt", 15, 37)]
2322
public void Analyzer_is_triggered(string filename, int diagnosticLine, int diagnosticColumn)
2423
{
2524
var source = ReadFile(filename);
2625

2726
var expectedDiagnostic = new DiagnosticResult
2827
{
29-
Id = DriveInfoAnalyzer.DiagnosticId,
30-
Message = DriveInfoAnalyzer.MessageFormat,
28+
Id = StringReaderAnalyzer.DiagnosticId,
29+
Message = StringReaderAnalyzer.MessageFormat,
3130
Severity = DiagnosticSeverity.Warning,
3231
Locations = new[] { new DiagnosticResultLocation("Test0.cs", diagnosticLine, diagnosticColumn) }
3332
};

System.IO.Abstractions.Analyzers.Tests/Analyzers/FileSystemWatcherAnalyzerTests.cs renamed to System.IO.Abstractions.Analyzers.Tests/Analyzers/StringWriterAnalyzerTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace System.IO.Abstractions.Analyzers.Tests.Analyzers
99
{
10-
public class FileSystemWatcherAnalyzerTests : CSharpDiagnosticAnalyzerTest<FileSystemWatcherAnalyzer>
10+
public class StringWriterAnalyzerTests: CSharpDiagnosticAnalyzerTest<StringWriterAnalyzer>
1111
{
1212
[Theory]
1313
[InlineData("Valid.txt")]
@@ -18,16 +18,15 @@ public void Analyzer_is_not_triggered(string filename)
1818
}
1919

2020
[Theory]
21-
[InlineData("WithOutFileSystem.txt", 15, 42)]
22-
[InlineData("StaticInvocation.txt", 15, 4)]
21+
[InlineData("WithOutFileSystem.txt", 15, 24)]
2322
public void Analyzer_is_triggered(string filename, int diagnosticLine, int diagnosticColumn)
2423
{
2524
var source = ReadFile(filename);
2625

2726
var expectedDiagnostic = new DiagnosticResult
2827
{
29-
Id = FileSystemWatcherAnalyzer.DiagnosticId,
30-
Message = FileSystemWatcherAnalyzer.MessageFormat,
28+
Id = StringWriterAnalyzer.DiagnosticId,
29+
Message = StringWriterAnalyzer.MessageFormat,
3130
Severity = DiagnosticSeverity.Warning,
3231
Locations = new[] { new DiagnosticResultLocation("Test0.cs", diagnosticLine, diagnosticColumn) }
3332
};

System.IO.Abstractions.Analyzers.Tests/System.IO.Abstractions.Analyzers.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
11+
<PackageReference Include="System.IO.Abstractions" Version="3.1.1" />
1112
<PackageReference Include="xunit" Version="2.4.1" />
1213
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
1314
</ItemGroup>

System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/DriveInfoAnalyzer/StaticInvocation.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/FileSystemWatcherAnalyzer/WithOutFileSystem.txt

Lines changed: 0 additions & 18 deletions
This file was deleted.

System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/DriveInfoAnalyzer/Valid.txt renamed to System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/StringReaderAnalyzer/Valid.txt

File renamed without changes.

System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/FileSystemWatcherAnalyzer/StaticInvocation.txt renamed to System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/StringReaderAnalyzer/WithOutFileSystem.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace SomeNameSpace
1212
{
1313
const string path = "C:\\temp.txt";
1414

15-
FileSystemWatcher.ReadMaxUserLimit(path);
15+
StringReader fileSystemWatcher = new StringReader();
1616
}
1717
}
1818
}

System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/FileSystemWatcherAnalyzer/Valid.txt renamed to System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/StringWriterAnalyzer/Valid.txt

File renamed without changes.

System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/DriveInfoAnalyzer/WithOutFileSystem.txt renamed to System.IO.Abstractions.Analyzers.Tests/TestData/Analyzer/StringWriterAnalyzer/WithOutFileSystem.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace SomeNameSpace
1212
{
1313
const string path = "C:\\temp.txt";
1414

15-
DriveInfo info = new DriveInfo("C");
15+
StringWriter info = new StringWriter("C");
1616
}
1717
}
1818
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
3+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
4+
<PropertyGroup>
5+
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
6+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
7+
<FileUpgradeFlags>
8+
</FileUpgradeFlags>
9+
<OldToolsVersion>14.0</OldToolsVersion>
10+
<UpgradeBackupLocation />
11+
</PropertyGroup>
12+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
13+
<PropertyGroup>
14+
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
15+
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<SchemaVersion>2.0</SchemaVersion>
18+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
19+
<ProjectGuid>{01F152B5-CC3C-44ED-A670-345CFCCC05DB}</ProjectGuid>
20+
<OutputType>Library</OutputType>
21+
<AppDesignerFolder>Properties</AppDesignerFolder>
22+
<RootNamespace>System.IO.Abstractions.Analyzers.Vsix</RootNamespace>
23+
<AssemblyName>System.IO.Abstractions.Analyzers</AssemblyName>
24+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
25+
<GeneratePkgDefFile>false</GeneratePkgDefFile>
26+
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
27+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
28+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
29+
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
30+
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
31+
<VSSDKTargetPlatformRegRootSuffix>Roslyn</VSSDKTargetPlatformRegRootSuffix>
32+
</PropertyGroup>
33+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
34+
<DebugSymbols>true</DebugSymbols>
35+
<DebugType>full</DebugType>
36+
<Optimize>false</Optimize>
37+
<OutputPath>bin\Debug\</OutputPath>
38+
<DefineConstants>DEBUG;TRACE</DefineConstants>
39+
<ErrorReport>prompt</ErrorReport>
40+
<WarningLevel>4</WarningLevel>
41+
</PropertyGroup>
42+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
43+
<DebugType>pdbonly</DebugType>
44+
<Optimize>true</Optimize>
45+
<OutputPath>bin\Release\</OutputPath>
46+
<DefineConstants>TRACE</DefineConstants>
47+
<ErrorReport>prompt</ErrorReport>
48+
<WarningLevel>4</WarningLevel>
49+
</PropertyGroup>
50+
<PropertyGroup>
51+
<StartAction>Program</StartAction>
52+
<StartProgram>$(DevEnvDir)devenv.exe</StartProgram>
53+
<StartArguments>/rootsuffix Roslyn</StartArguments>
54+
</PropertyGroup>
55+
<ItemGroup>
56+
<None Include="source.extension.vsixmanifest">
57+
<SubType>Designer</SubType>
58+
</None>
59+
</ItemGroup>
60+
<ItemGroup>
61+
<ProjectReference Include="..\System.IO.Abstractions.Analyzers\System.IO.Abstractions.Analyzers.csproj">
62+
<Project>{8EEAAD65-1247-4503-9BBC-B3EA8BC06735}</Project>
63+
<Name>System.IO.Abstractions.Analyzers</Name>
64+
</ProjectReference>
65+
</ItemGroup>
66+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
67+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
68+
</Project>

0 commit comments

Comments
 (0)