Skip to content
Browse files

ReSharper 7 support, based on SDK and improved test coverage

  • Loading branch information...
1 parent 4198fd5 commit 6185888a4a01d17c086ee609d480c121b2056c5d @joaroyen committed Jul 28, 2012
Showing with 797 additions and 657 deletions.
  1. +52 −0 .gitattributes
  2. +48 −9 .gitignore
  3. +6 −0 .nuget/NuGet.Config
  4. +139 −0 .nuget/NuGet.targets
  5. +2 −2 Deploy.bat
  6. +22 −0 JoarOyen.ReSharperPlugIn.Tests/DomainAndUsernameMacroTests.cs
  7. +72 −0 JoarOyen.ReSharperPlugIn.Tests/JoarOyen.ReSharperPlugIn.Tests.csproj
  8. +19 −0 JoarOyen.ReSharperPlugIn.Tests/JoarOyen.ReSharperPlugIn.Tests.ncrunchproject
  9. +47 −0 JoarOyen.ReSharperPlugIn.Tests/Properties/AssemblyInfo.cs
  10. +96 −0 JoarOyen.ReSharperPlugIn.Tests/QuickParameterlessMacroTests.cs
  11. +47 −0 JoarOyen.ReSharperPlugIn.Tests/ValidIdentifierTests.cs
  12. +4 −0 JoarOyen.ReSharperPlugIn.Tests/packages.config
  13. +25 −0 JoarOyen.ReSharperPlugIn/AboutAction.cs
  14. +9 −0 JoarOyen.ReSharperPlugIn/Actions.xml
  15. +13 −3 {Macros → JoarOyen.ReSharperPlugIn}/DomainAndUsernameMacro.cs
  16. +61 −0 JoarOyen.ReSharperPlugIn/JoarOyen.ReSharperPlugIn.csproj
  17. +24 −0 JoarOyen.ReSharperPlugIn/JoarOyen.ReSharperPlugIn.ncrunchproject
  18. +25 −0 JoarOyen.ReSharperPlugIn/Properties/AssemblyInfo.cs
  19. +3 −3 {Macros → JoarOyen.ReSharperPlugIn}/QuickParameterlessMacro.cs
  20. +1 −1 {Macros → JoarOyen.ReSharperPlugIn}/ValidIdentifierMacro.cs
  21. +0 −10 Local.testsettings
  22. +0 −85 Macros/Macros.csproj
  23. +0 −41 Macros/Properties/AssemblyInfo.cs
  24. +0 −23 Macros/RecentItemListMacro.cs
  25. +7 −5 README.md
  26. +12 −0 ReSharperExtensions.ncrunchsolution
  27. +32 −64 ReSharperExtensions.sln
  28. +31 −0 ReSharperExtensions.sln.DotSettings
  29. +0 −6 ReSharperExtensions.vsmdi
  30. +0 −16 Templates/Live Templates/JoarOyen Templates.xml
  31. +0 −61 Templates/Templates.csproj
  32. +0 −67 Test/MSTestProject/MSTestProject.csproj
  33. +0 −35 Test/MSTestProject/Properties/AssemblyInfo.cs
  34. +0 −10 Test/MSTestProject/UnitTest1.cs
  35. +0 −16 Test/Macros.Tests.Unit/AssemblyInitialize.cs
  36. +0 −17 Test/Macros.Tests.Unit/DomainAndUsernameMacroTests.cs
  37. +0 −80 Test/Macros.Tests.Unit/Macros.Tests.Unit.csproj
  38. +0 −35 Test/Macros.Tests.Unit/Properties/AssemblyInfo.cs
  39. +0 −47 Test/Macros.Tests.Unit/ValidIdentifierTests.cs
  40. +0 −21 TraceAndTestImpact.testsettings
View
52 .gitattributes
@@ -0,0 +1,52 @@
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
+
+*.jpg binary
+*.png binary
+*.gif binary
+
+*.cs text=auto diff=csharp
+*.vb text=auto
+*.c text=auto
+*.cpp text=auto
+*.cxx text=auto
+*.h text=auto
+*.hxx text=auto
+*.py text=auto
+*.rb text=auto
+*.java text=auto
+*.html text=auto
+*.htm text=auto
+*.css text=auto
+*.scss text=auto
+*.sass text=auto
+*.less text=auto
+*.js text=auto
+*.lisp text=auto
+*.clj text=auto
+*.sql text=auto
+*.php text=auto
+*.lua text=auto
+*.m text=auto
+*.asm text=auto
+*.erl text=auto
+*.fs text=auto
+*.fsx text=auto
+*.hs text=auto
+
+*.csproj text=auto merge=union
+*.vbproj text=auto merge=union
+*.fsproj text=auto merge=union
+*.dbproj text=auto merge=union
+*.sln text=auto eol=crlf merge=union
+
+*.dll binary
+*.snk binary
View
57 .gitignore
@@ -1,30 +1,69 @@
-#ignore thumbnails created by windows
-Thumbs.db
-#Ignore files build by Visual Studio
-*.obj
+#OS junk files
+[Tt]humbs.db
+Desktop.ini
+*.DS_Store
+
+#Sublime Text files
+*.sublime-workspace
+
+#Webstorm files
+*.idea
+.idea
+.idea/
+
+#Visual Studio files
+*.docstates
+*.[Oo]bj
+*.dat
+*.crc
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
+*.vssscc
*_i.c
*_p.c
-*.ncb
+*.ncb
*.suo
*.tlb
*.tlh
*.bak
-*.cache
+*.[Cc]ache
*.ilk
*.log
-[Bb]in
-[Dd]ebug*/
*.lib
*.sbr
+*.sdf
+ipch/
obj/
+[Bb]in
+[Dd]ebug*/
[Rr]elease*/
+Ankh.NoLoad
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+
+#Python
+*.py[co]
+
+#MonoDevelop
+*.userprefs
+*.usertasks
+*.pidb
+test-results/
+
+#Tooling
_ReSharper*/
+*.[Rr]e[Ss]harper
[Tt]est[Rr]esult*
*.gpstate
-*.sln.docstates
+*.dotCover
+
+# Office Temp Files
+~$*
+
+#NuGet
+packages/
View
6 .nuget/NuGet.Config
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <solution>
+ <add key="disableSourceControlIntegration" value="true" />
+ </solution>
+</configuration>
View
139 .nuget/NuGet.targets
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
+
+ <!-- Enable the restore command to run before builds -->
+ <RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
+
+ <!-- Property that enables building a package from a project -->
+ <BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
+
+ <!-- Download NuGet.exe if it does not already exist -->
+ <DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
+ </PropertyGroup>
+
+ <ItemGroup Condition=" '$(PackageSources)' == '' ">
+ <!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
+ <!--
+ <PackageSource Include="https://nuget.org/api/v2/" />
+ <PackageSource Include="https://my-nuget-source/nuget/" />
+ -->
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
+ <!-- Windows specific commands -->
+ <NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
+ <PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
+ <PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
+ </PropertyGroup>
+
+ <PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
+ <!-- We need to launch nuget.exe with the mono command if we're not on windows -->
+ <NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
+ <PackagesConfig>packages.config</PackagesConfig>
+ <PackagesDir>$(SolutionDir)packages</PackagesDir>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <!-- NuGet command -->
+ <NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
+ <PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
+
+ <NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
+ <NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
+
+ <PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
+
+ <!-- Commands -->
+ <RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" -o "$(PackagesDir)"</RestoreCommand>
+ <BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
+
+ <!-- Make the build depend on restore packages -->
+ <BuildDependsOn Condition="$(RestorePackages) == 'true'">
+ RestorePackages;
+ $(BuildDependsOn);
+ </BuildDependsOn>
+
+ <!-- Make the build depend on restore packages -->
+ <BuildDependsOn Condition="$(BuildPackage) == 'true'">
+ $(BuildDependsOn);
+ BuildPackage;
+ </BuildDependsOn>
+ </PropertyGroup>
+
+ <Target Name="CheckPrerequisites">
+ <!-- Raise an error if we're unable to locate nuget.exe -->
+ <Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
+ <SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
+ <DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
+ </Target>
+
+ <Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
+ <Exec Command="$(RestoreCommand)"
+ Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
+
+ <Exec Command="$(RestoreCommand)"
+ LogStandardErrorAsError="true"
+ Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
+ </Target>
+
+ <Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
+ <Exec Command="$(BuildCommand)"
+ Condition=" '$(OS)' != 'Windows_NT' " />
+
+ <Exec Command="$(BuildCommand)"
+ LogStandardErrorAsError="true"
+ Condition=" '$(OS)' == 'Windows_NT' " />
+ </Target>
+
+ <UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+ <ParameterGroup>
+ <OutputFilename ParameterType="System.String" Required="true" />
+ </ParameterGroup>
+ <Task>
+ <Reference Include="System.Core" />
+ <Using Namespace="System" />
+ <Using Namespace="System.IO" />
+ <Using Namespace="System.Net" />
+ <Using Namespace="Microsoft.Build.Framework" />
+ <Using Namespace="Microsoft.Build.Utilities" />
+ <Code Type="Fragment" Language="cs">
+ <![CDATA[
+ try {
+ OutputFilename = Path.GetFullPath(OutputFilename);
+
+ Log.LogMessage("Downloading latest version of NuGet.exe...");
+ WebClient webClient = new WebClient();
+ webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
+
+ return true;
+ }
+ catch (Exception ex) {
+ Log.LogErrorFromException(ex);
+ return false;
+ }
+ ]]>
+ </Code>
+ </Task>
+ </UsingTask>
+
+ <UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+ <ParameterGroup>
+ <EnvKey ParameterType="System.String" Required="true" />
+ <EnvValue ParameterType="System.String" Required="true" />
+ </ParameterGroup>
+ <Task>
+ <Using Namespace="System" />
+ <Code Type="Fragment" Language="cs">
+ <![CDATA[
+ try {
+ Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
+ }
+ catch {
+ }
+ ]]>
+ </Code>
+ </Task>
+ </UsingTask>
+</Project>
View
4 Deploy.bat
@@ -1,6 +1,6 @@
-set ReSharperPluginDirectory="%ProgramFiles(x86)%\JetBrains\ReSharper\v6.1\Bin\Plugins\JoarOyen"
+set ReSharperPluginDirectory="%ProgramFiles(x86)%\JetBrains\ReSharper\v7.0\Bin\Plugins\JoarOyen"
if not exist %ReSharperPluginDirectory% md %ReSharperPluginDirectory%
-copy /Y Macros\bin\Debug\JoarOyen.Tools.ReSharper.Macros.* %ReSharperPluginDirectory%
+copy /Y JoarOyen.ReSharperPlugIn\bin\Debug\JoarOyen.ReSharperPlugIn.* %ReSharperPluginDirectory%
pause
View
22 JoarOyen.ReSharperPlugIn.Tests/DomainAndUsernameMacroTests.cs
@@ -0,0 +1,22 @@
+using NUnit.Framework;
+
+namespace JoarOyen.ReSharperPlugIn.Tests
+{
+ [TestFixture]
+ public class DomainAndUsernameMacroTests
+ {
+ private readonly DomainAndUsernameMacro _domainAndUsernameMacro = new DomainAndUsernameMacro();
+
+ [TestCase(Category = "Unit")]
+ public void Getting_the_current_domain_and_username_returns_domain_and_user_name_with_one_escaped_backslash_when_not_at_hotspot()
+ {
+ Assert.That(_domainAndUsernameMacro.QuickEvaluate(null), Contains.Substring("\\"));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Getting_the_current_domain_and_username_returns_domain_and_user_name_with_two_escaped_backslash_when_at_hotspot()
+ {
+ Assert.That(_domainAndUsernameMacro.QuickEvaluate("domain\\user"), Contains.Substring("\\\\"));
+ }
+ }
+}
View
72 JoarOyen.ReSharperPlugIn.Tests/JoarOyen.ReSharperPlugIn.Tests.csproj
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B1C3175A-4D88-46F0-83A7-25AA37B057FD}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>JoarOyen.ReSharperPlugIn.Tests</RootNamespace>
+ <AssemblyName>JoarOyen.ReSharperPlugIn.Tests</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>JET_MODE_ASSERT;DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="NSubstitute">
+ <HintPath>..\packages\NSubstitute.1.4.2.0\lib\NET35\NSubstitute.dll</HintPath>
+ </Reference>
+ <Reference Include="PresentationCore" />
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="DomainAndUsernameMacroTests.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="QuickParameterlessMacroTests.cs" />
+ <Compile Include="ValidIdentifierTests.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\JoarOyen.ReSharperPlugIn\JoarOyen.ReSharperPlugIn.csproj">
+ <Project>{50B2B447-87A5-4222-97FC-4459310DA9DF}</Project>
+ <Name>JoarOyen.ReSharperPlugIn</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ReSharperSdkTargets Condition=" '$(ReSharperSdkTargets)' == '' ">$(MSBuildExtensionsPath)\JetBrains\ReSharper.SDK\v7.0</ReSharperSdkTargets>
+ </PropertyGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(ReSharperSdkTargets)\Plugin.Tests.Targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+</Project>
View
19 JoarOyen.ReSharperPlugIn.Tests/JoarOyen.ReSharperPlugIn.Tests.ncrunchproject
@@ -0,0 +1,19 @@
+<ProjectConfiguration>
+ <CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
+ <ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
+ <PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
+ <AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
+ <AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
+ <IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
+ <RunPreBuildEvents>false</RunPreBuildEvents>
+ <RunPostBuildEvents>false</RunPostBuildEvents>
+ <PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
+ <InstrumentAssembly>true</InstrumentAssembly>
+ <PreventSigningOfAssembly>false</PreventSigningOfAssembly>
+ <AnalyseExecutionTimes>true</AnalyseExecutionTimes>
+ <IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
+ <DefaultTestTimeout>60000</DefaultTestTimeout>
+ <UseBuildConfiguration />
+ <ProxyProcessPath />
+ <UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
+</ProjectConfiguration>
View
47 JoarOyen.ReSharperPlugIn.Tests/Properties/AssemblyInfo.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Security.Principal;
+using JetBrains.Application;
+using JetBrains.Threading;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using NUnit.Framework;
+
+/// <summary>
+/// Test environment. Must be in the global namespace.
+/// </summary>
+[SetUpFixture]
+public class TestEnvironmentAssembly : ReSharperTestEnvironmentAssembly
+{
+ /// <summary>
+ /// Gets the assemblies to load into test environment.
+ /// Should include all assemblies which contain components.
+ /// </summary>
+ private static IEnumerable<Assembly> GetAssembliesToLoad()
+ {
+ // Test assembly
+ yield return Assembly.GetExecutingAssembly();
+
+ #warning you need to replace 'object' below with a type from the assembly being tested
+ yield return typeof(object).Assembly;
+ }
+
+ public override void SetUp()
+ {
+ base.SetUp();
+ ReentrancyGuard.Current.Execute(
+ "LoadAssemblies",
+ () => Shell.Instance.GetComponent<AssemblyManager>().LoadAssemblies(
+ GetType().Name, GetAssembliesToLoad()));
+ }
+
+ public override void TearDown()
+ {
+ ReentrancyGuard.Current.Execute(
+ "UnloadAssemblies",
+ () => Shell.Instance.GetComponent<AssemblyManager>().UnloadAssemblies(
+ GetType().Name, GetAssembliesToLoad()));
+ base.TearDown();
+ }
+}
View
96 JoarOyen.ReSharperPlugIn.Tests/QuickParameterlessMacroTests.cs
@@ -0,0 +1,96 @@
+using System.Collections.Generic;
+using JetBrains.DocumentModel;
+using JetBrains.ReSharper.Feature.Services.LiveTemplates.Hotspots;
+using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros;
+using JetBrains.ReSharper.LiveTemplates;
+using NSubstitute;
+using NUnit.Framework;
+
+namespace JoarOyen.ReSharperPlugIn.Tests
+{
+ [TestFixture]
+ public class QuickParameterlessMacroTests
+ {
+ private readonly QuickParameterlessMacro _quickParamterlessMacro;
+ private readonly IHotspotContext _context;
+ private readonly IHotspotSession _hotspotSession;
+
+ public QuickParameterlessMacroTests()
+ {
+ _quickParamterlessMacro = new DomainAndUsernameMacro();
+ _hotspotSession = CreateFakeHotspotSession();
+ _context = CreateFakeHotspotContext(_hotspotSession);
+ }
+
+ [TestCase(Category="Unit")]
+ public void Has_no_parameters()
+ {
+ Assert.That(_quickParamterlessMacro.Parameters, Has.Length.EqualTo(0));
+ }
+
+ [TestCase(Category="Unit")]
+ public void Has_no_lookup_items()
+ {
+ Assert.That(_quickParamterlessMacro.GetLookupItems(null, null), Is.Null);
+ }
+
+ [TestCase(Category="Unit")]
+ public void Has_a_dummy_placeholder()
+ {
+ Assert.That(_quickParamterlessMacro.GetPlaceholder(null), Is.EqualTo("a"));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Evaluates_to_null_for_templates_without_hotspots()
+ {
+ var hotspotSession = Substitute.For<IHotspotSession>();
+ hotspotSession.Hotspots.Returns(new List<Hotspot>());
+ var context = Substitute.For<IHotspotContext>();
+ context.HotspotSession.Returns(hotspotSession);
+
+ Assert.That(_quickParamterlessMacro.EvaluateQuickResult(context, null), Is.Null);
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Evaluates_to_a_non_empty_string_for_templates_with_a_valid_hotspot()
+ {
+ Assert.That(_quickParamterlessMacro.EvaluateQuickResult(_context, null), Has.Length.GreaterThan(0));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Handle_expansion_returns_false()
+ {
+ Assert.That(_quickParamterlessMacro.HandleExpansion(_context, null), Is.False);
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Test()
+ {
+ _quickParamterlessMacro.HotspotSessionHotspotUpdated(_hotspotSession, null);
+ }
+
+ private IHotspotContext CreateFakeHotspotContext(IHotspotSession hotspotSession)
+ {
+ var context = Substitute.For<IHotspotContext>();
+ context.HotspotSession.Returns(hotspotSession);
+ return context;
+ }
+
+ private IHotspotSession CreateFakeHotspotSession()
+ {
+ var hotspotSession = Substitute.For<IHotspotSession>();
+ var templateField = new TemplateField("", new MacroCallExpression(_quickParamterlessMacro), 0);
+ var hotspot = new Hotspot(new HotspotInfo(templateField), hotspotSession);
+ var rangeMarger = Substitute.For<IRangeMarker>();
+ hotspot.RangeMarkers.Add(rangeMarger);
+
+ var hotspots = new List<Hotspot>
+ {
+ new Hotspot(new HotspotInfo(new TemplateField("", 0)), hotspotSession),
+ hotspot
+ };
+ hotspotSession.Hotspots.Returns(hotspots);
+ return hotspotSession;
+ }
+ }
+}
View
47 JoarOyen.ReSharperPlugIn.Tests/ValidIdentifierTests.cs
@@ -0,0 +1,47 @@
+using NUnit.Framework;
+
+namespace JoarOyen.ReSharperPlugIn.Tests
+{
+ [TestFixture]
+ public class ValidIdentifierTests
+ {
+ readonly ValidIdentifierMacro _validIdentifierMacro = new ValidIdentifierMacro();
+
+ [TestCase(Category = "Unit")]
+ public void Empty_identifier_returns_empty()
+ {
+
+ Assert.That(_validIdentifierMacro.QuickEvaluate(""), Is.EqualTo(""));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Valid_identifier_returns_an_unmodified_value()
+ {
+ Assert.That(_validIdentifierMacro.QuickEvaluate("This_is_a_valid_identifier42"), Is.EqualTo("This_is_a_valid_identifier42"));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void An_identifier_starting_with_a_number_is_prefixed_with_an_underscore()
+ {
+ Assert.That(_validIdentifierMacro.QuickEvaluate("1InvalidIdentifier"), Is.EqualTo("_1InvalidIdentifier"));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void An_identifier_starting_with_an_underscore_is_not_prefixed_with_another_underscore()
+ {
+ Assert.That(_validIdentifierMacro.QuickEvaluate("_1InvalidIdentifier"), Is.EqualTo("_1InvalidIdentifier"));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Invalid_characters_in_an_identifier_is_replaced_with_underscores()
+ {
+ Assert.That(_validIdentifierMacro.QuickEvaluate("Invalid identifier #/!-"), Is.EqualTo("Invalid_identifier_____"));
+ }
+
+ [TestCase(Category = "Unit")]
+ public void Norwegian_characters_are_valid()
+ {
+ Assert.That(_validIdentifierMacro.QuickEvaluate("Valid_norwegian_identifier_æøåÆØÅ"), Is.EqualTo("Valid_norwegian_identifier_æøåÆØÅ"));
+ }
+ }
+}
View
4 JoarOyen.ReSharperPlugIn.Tests/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="NSubstitute" version="1.4.2.0" targetFramework="net35" />
+</packages>
View
25 JoarOyen.ReSharperPlugIn/AboutAction.cs
@@ -0,0 +1,25 @@
+using System.Windows.Forms;
+using JetBrains.ActionManagement;
+using JetBrains.Application.DataContext;
+
+namespace JoarOyen.ReSharperPlugIn
+{
+ [ActionHandler("JoarOyen.ReSharperPlugIn.About")]
+ public class AboutAction : IActionHandler
+ {
+ public bool Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate)
+ {
+ // return true or false to enable/disable this action
+ return true;
+ }
+
+ public void Execute(IDataContext context, DelegateExecute nextExecute)
+ {
+ MessageBox.Show(
+ "Joar Øyen's extensions for ReSharper\nJoar Øyen\n\nContains Live Templates and macros for writing test methods",
+ "About Joar Øyen's extensions for ReSharper",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Information);
+ }
+ }
+}
View
9 JoarOyen.ReSharperPlugIn/Actions.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<actions>
+ <insert group-id="ReSharper" position="last">
+ <action-group id="JoarOyen.ReSharperPlugIn" text="JoarOyen.ReSharperPlugIn">
+ <action id="JoarOyen.ReSharperPlugIn.About" text="About Joar Øyen's extensions for ReSharper"/>
+ <!-- to break up elements use <separator/> -->
+ </action-group>
+ </insert>
+</actions>
View
16 Macros/DomainAndUsernameMacro.cs → ...ReSharperPlugIn/DomainAndUsernameMacro.cs
@@ -1,7 +1,8 @@
-using System.Threading;
+using System.Diagnostics;
+using System.Security.Principal;
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros;
-namespace JoarOyen.Tools.ReSharper.Macros
+namespace JoarOyen.ReSharperPlugIn
{
[Macro("JoarOyenLiveTemplateMacros.DomainAndUsername",
ShortDescription = "Current username with domain",
@@ -10,7 +11,16 @@ public class DomainAndUsernameMacro : QuickParameterlessMacro
{
public override string QuickEvaluate(string value)
{
- return Thread.CurrentPrincipal.Identity.Name;
+ var windowsIdentity = WindowsIdentity.GetCurrent();
+ Debug.Assert(windowsIdentity != null);
+ string name = windowsIdentity.Name;
+
+ if (value != null && value.Contains("\\"))
+ {
+ name = name.Replace("\\", "\\\\");
+ }
+
+ return name;
}
}
}
View
61 JoarOyen.ReSharperPlugIn/JoarOyen.ReSharperPlugIn.csproj
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{50B2B447-87A5-4222-97FC-4459310DA9DF}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>JoarOyen.ReSharperPlugIn</RootNamespace>
+ <AssemblyName>JoarOyen.ReSharperPlugIn</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>JET_MODE_ASSERT;DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="PresentationCore" />
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="DomainAndUsernameMacro.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="AboutAction.cs" />
+ <Compile Include="QuickParameterlessMacro.cs" />
+ <Compile Include="ValidIdentifierMacro.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Actions.xml" />
+ </ItemGroup>
+ <PropertyGroup>
+ <ReSharperSdkTargets Condition=" '$(ReSharperSdkTargets)' == '' ">$(MSBuildExtensionsPath)\JetBrains\ReSharper.SDK\v7.0</ReSharperSdkTargets>
+ </PropertyGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(ReSharperSdkTargets)\Plugin.Targets" />
+</Project>
View
24 JoarOyen.ReSharperPlugIn/JoarOyen.ReSharperPlugIn.ncrunchproject
@@ -0,0 +1,24 @@
+<ProjectConfiguration>
+ <CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
+ <ConsiderInconclusiveTestsAsPassing>false</ConsiderInconclusiveTestsAsPassing>
+ <PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
+ <AllowDynamicCodeContractChecking>true</AllowDynamicCodeContractChecking>
+ <AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
+ <IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
+ <RunPreBuildEvents>false</RunPreBuildEvents>
+ <RunPostBuildEvents>false</RunPostBuildEvents>
+ <PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
+ <InstrumentAssembly>true</InstrumentAssembly>
+ <PreventSigningOfAssembly>false</PreventSigningOfAssembly>
+ <AnalyseExecutionTimes>true</AnalyseExecutionTimes>
+ <IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
+ <DefaultTestTimeout>60000</DefaultTestTimeout>
+ <UseBuildConfiguration />
+ <ProxyProcessPath />
+ <UseCPUArchitecture>AutoDetect</UseCPUArchitecture>
+ <IgnoredTests>
+ <RegexTestSelector>
+ <RegularExpression>.*</RegularExpression>
+ </RegexTestSelector>
+ </IgnoredTests>
+</ProjectConfiguration>
View
25 JoarOyen.ReSharperPlugIn/Properties/AssemblyInfo.cs
@@ -0,0 +1,25 @@
+using System.Reflection;
+using JetBrains.ActionManagement;
+using JetBrains.Application.PluginSupport;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("JoarOyen.ReSharperPlugIn")]
+[assembly: AssemblyDescription("Contains Live Templates and macros for writing test methods")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Joar Øyen")]
+[assembly: AssemblyProduct("JoarOyen.ReSharperPlugIn")]
+[assembly: AssemblyCopyright("Copyright © Joar Øyen, 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+
+[assembly: ActionsXml("JoarOyen.ReSharperPlugIn.Actions.xml")]
+
+// The following information is displayed by ReSharper in the Plugins dialog
+[assembly: PluginTitle("Joar Øyen's extensions for ReSharper")]
+[assembly: PluginDescription("Contains Live Templates and macros for writing test methods")]
+[assembly: PluginVendor("Joar Øyen")]
View
6 Macros/QuickParameterlessMacro.cs → ...eSharperPlugIn/QuickParameterlessMacro.cs
@@ -4,7 +4,7 @@
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros;
using JetBrains.Util;
-namespace JoarOyen.Tools.ReSharper.Macros
+namespace JoarOyen.ReSharperPlugIn
{
public abstract class QuickParameterlessMacro : IMacro
{
@@ -45,9 +45,9 @@ public bool HandleExpansion(IHotspotContext context, IList<string> arguments)
return false;
}
- private void HotspotSessionHotspotUpdated(object sender, System.EventArgs e)
+ public void HotspotSessionHotspotUpdated(object sender, System.EventArgs e)
{
- var hotspotSession = (HotspotSession)sender;
+ var hotspotSession = (IHotspotSession)sender;
foreach (var hotspot in hotspotSession.Hotspots)
{
View
2 Macros/ValidIdentifierMacro.cs → ...n.ReSharperPlugIn/ValidIdentifierMacro.cs
@@ -1,7 +1,7 @@
using System.Text;
using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros;
-namespace JoarOyen.Tools.ReSharper.Macros
+namespace JoarOyen.ReSharperPlugIn
{
[Macro("JoarOyenLiveTemplateMacros.ValidIdentifier",
ShortDescription = "Ensures that given variable is a valid C# identifier",
View
10 Local.testsettings
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<TestSettings name="Local" id="b32d296d-a14d-43ca-8b1b-9ce26b6a0392" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
- <Description>These are default test settings for a local test run.</Description>
- <Deployment enabled="false" />
- <Execution>
- <TestTypeSpecific />
- <AgentRule name="Execution Agents">
- </AgentRule>
- </Execution>
-</TestSettings>
View
85 Macros/Macros.csproj
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{7D1A00EB-6067-4A94-B476-83B5DABFD0BD}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>JoarOyen.Tools.ReSharper.Macros</RootNamespace>
- <AssemblyName>JoarOyen.Tools.ReSharper.Macros</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <SccProjectName>
- </SccProjectName>
- <SccLocalPath>
- </SccLocalPath>
- <SccAuxPath>
- </SccAuxPath>
- <SccProvider>
- </SccProvider>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="JetBrains.Platform.ReSharper.ComponentModel, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.Platform.ReSharper.ComponentModel.dll</HintPath>
- </Reference>
- <Reference Include="JetBrains.Platform.ReSharper.DocumentModel, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.Platform.ReSharper.DocumentModel.dll</HintPath>
- </Reference>
- <Reference Include="JetBrains.Platform.ReSharper.Shell, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.Platform.ReSharper.Shell.dll</HintPath>
- </Reference>
- <Reference Include="JetBrains.Platform.ReSharper.TextControl, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.Platform.ReSharper.TextControl.dll</HintPath>
- </Reference>
- <Reference Include="JetBrains.Platform.ReSharper.Util, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.Platform.ReSharper.Util.dll</HintPath>
- </Reference>
- <Reference Include="JetBrains.ReSharper.Feature.Services, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.ReSharper.Feature.Services.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="DomainAndUsernameMacro.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="QuickParameterlessMacro.cs" />
- <Compile Include="ValidIdentifierMacro.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
41 Macros/Properties/AssemblyInfo.cs
@@ -1,41 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-using JetBrains.Application.PluginSupport;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("JoarOyen.Tools.ReSharper.Macros")]
-[assembly: AssemblyDescription("Macros for JetBrains ReSharper. Tested with ReSharper 6.1 and Visual Studio 2010.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Joar Øyen")]
-[assembly: AssemblyProduct("ReSharper Macros")]
-[assembly: AssemblyCopyright("Copyright © Joar Øyen 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: PluginTitle("JoarOyen.Tools.ReSharper.Macros")]
-[assembly: PluginDescription("Macros for JetBrains ReSharper: Domain and username, regular expression replacement and valid identifier. Tested with ReSharper 6.1 and Visual Studio 2010.")]
-[assembly: PluginVendor("Joar Øyen")]
-
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("b64cb605-34c8-48ec-a035-ecca56b16681")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
23 Macros/RecentItemListMacro.cs
@@ -1,23 +0,0 @@
-using System.Collections.Generic;
-using JetBrains.ReSharper.Feature.Services.LiveTemplates.Hotspots;
-using JetBrains.ReSharper.Feature.Services.LiveTemplates.Macros;
-using JetBrains.ReSharper.Feature.Services.Lookup;
-
-namespace JoarOyen.Tools.ReSharper.Macros
-{
- [Macro("JoarOyenLiveTemplateMacros.RecentItemList",
- ShortDescription = "List of recent items",
- LongDescription = "List of recent items")]
- public class RecentItemListMacro : QuickParameterlessMacro
- {
- public override string QuickEvaluate(string value)
- {
- return value;
- }
-
- public override HotspotItems GetLookupItems(IHotspotContext context, IList<string> arguments)
- {
- return new HotspotItems(new List<ILookupItem>() { new TextLookupItem("Value 1"), new TextLookupItem("Value 2") });
- }
- }
-}
View
12 README.md
@@ -1,11 +1,13 @@
ReSharperExtensions
===================
-This solution contains Live Templates and macros for [JetBrains ReSharper](http://www.jetbrains.com/resharper/). The tm template allows you to write test method names as sentences with spaces, and the macro will replace the spaces with underscores as you type.
+This solution contains Live Templates and macros for [JetBrains ReSharper](http://www.jetbrains.com/resharper/). You can check out an example template for MSTest in the ReSharper settings for this solution. The tm template allows you to write test method names as sentences with spaces, and the macro will replace the spaces with underscores as you type. It also allows you to select an MSTest category and assigns the current user as the owner of the test in a format compatible with TFS.
See [http://www.joaroyen.com/2010/08/resharpers-live-templates-can-do.html](http://www.joaroyen.com/2010/08/resharpers-live-templates-can-do.html) for more information.
-The master branch is updated to with support for ReSharper 6, while support for ReSharper 5 is maintained in a separate branch.
-
-## Tip ##
-You can mount the template files in the Template Explorer to simplify the process of modifying the various live templates.
+## Comments ##
+* Master is updated to support ReSharper 7, and requires .NET 4.0 or newer. The macros can therefore only be used in VS2010 and VS2012.
+* Macros that works with previous versions of ReSharper and Visual Studio are available in separate branches for each version of ReSharper.
+* The code in this version is built with the ReSharper SDK, and the namespace for the macros has been changed to reflect the new name of the assembly.
+* The test project is using NUnit from ReSharper SDK, but uses NuGet for NSubstitute (this dependency should be downloaded automatically).
+* The Deploy.bat file must be run with administrative privilegies if UAC is enabled
View
12 ReSharperExtensions.ncrunchsolution
@@ -0,0 +1,12 @@
+<SolutionConfiguration>
+ <FileVersion>1</FileVersion>
+ <AutoEnableOnStartup>True</AutoEnableOnStartup>
+ <AllowParallelTestExecution>false</AllowParallelTestExecution>
+ <FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
+ <FrameworkUtilisationTypeForGallio>UseStaticAnalysis</FrameworkUtilisationTypeForGallio>
+ <FrameworkUtilisationTypeForMSpec>UseStaticAnalysis</FrameworkUtilisationTypeForMSpec>
+ <FrameworkUtilisationTypeForMSTest>UseStaticAnalysis</FrameworkUtilisationTypeForMSTest>
+ <EngineModes>Run all tests automatically:BFRydWU=;Run all tests manually:BUZhbHNl;Run impacted tests automatically, others manually (experimental!):CklzSW1wYWN0ZWQ=;Run pinned tests automatically, others manually:CElzUGlubmVk</EngineModes>
+ <MetricsExclusionList>
+</MetricsExclusionList>
+</SolutionConfiguration>
View
96 ReSharperExtensions.sln
@@ -1,33 +1,25 @@

-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Macros", "Macros\Macros.csproj", "{7D1A00EB-6067-4A94-B476-83B5DABFD0BD}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Templates", "Templates\Templates.csproj", "{B7FEC423-AA66-4568-8381-9D9A7042FE3B}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{CCA87CAB-F09E-45BB-B123-9002102C76DE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTestProject", "Test\MSTestProject\MSTestProject.csproj", "{055A163B-EA7F-4195-A4D0-D522115AD6D4}"
-EndProject
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{00465A82-90E8-4B47-8022-F159490A9C40}"
ProjectSection(SolutionItems) = preProject
- Local.testsettings = Local.testsettings
+ Deploy.bat = Deploy.bat
README.md = README.md
- ReSharperExtensions.vsmdi = ReSharperExtensions.vsmdi
- TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
+ ReSharperExtensions.sln.DotSettings = ReSharperExtensions.sln.DotSettings
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deployment", "Deployment", "{47355A91-A1D2-4305-AC99-6090D523DFC5}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoarOyen.ReSharperPlugIn", "JoarOyen.ReSharperPlugIn\JoarOyen.ReSharperPlugIn.csproj", "{50B2B447-87A5-4222-97FC-4459310DA9DF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JoarOyen.ReSharperPlugIn.Tests", "JoarOyen.ReSharperPlugIn.Tests\JoarOyen.ReSharperPlugIn.Tests.csproj", "{B1C3175A-4D88-46F0-83A7-25AA37B057FD}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{EBC0E906-0655-41F9-B029-9AAE922081B5}"
ProjectSection(SolutionItems) = preProject
- Deploy.bat = Deploy.bat
+ .nuget\NuGet.Config = .nuget\NuGet.Config
+ .nuget\NuGet.targets = .nuget\NuGet.targets
+ .nuget\nuget.exe = .nuget\nuget.exe
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Macros.Tests.Unit", "Test\Macros.Tests.Unit\Macros.Tests.Unit.csproj", "{614FD39A-6B4A-4A55-91E8-85C2E1D63260}"
-EndProject
Global
- GlobalSection(TestCaseManagementSettings) = postSolution
- CategoryFile = ReSharperExtensions.vsmdi
- EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
@@ -37,52 +29,28 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Debug|x86.ActiveCfg = Debug|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Release|Any CPU.Build.0 = Release|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {7D1A00EB-6067-4A94-B476-83B5DABFD0BD}.Release|x86.ActiveCfg = Release|Any CPU
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Debug|Any CPU.ActiveCfg = Debug|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Debug|x86.ActiveCfg = Debug|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Debug|x86.Build.0 = Debug|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Release|Any CPU.ActiveCfg = Release|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Release|Mixed Platforms.Build.0 = Release|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Release|x86.ActiveCfg = Release|x86
- {B7FEC423-AA66-4568-8381-9D9A7042FE3B}.Release|x86.Build.0 = Release|x86
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Debug|x86.ActiveCfg = Debug|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Release|Any CPU.Build.0 = Release|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {055A163B-EA7F-4195-A4D0-D522115AD6D4}.Release|x86.ActiveCfg = Release|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Debug|x86.ActiveCfg = Debug|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Release|Any CPU.Build.0 = Release|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260}.Release|x86.ActiveCfg = Release|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {50B2B447-87A5-4222-97FC-4459310DA9DF}.Release|x86.ActiveCfg = Release|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {B1C3175A-4D88-46F0-83A7-25AA37B057FD}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {055A163B-EA7F-4195-A4D0-D522115AD6D4} = {CCA87CAB-F09E-45BB-B123-9002102C76DE}
- {614FD39A-6B4A-4A55-91E8-85C2E1D63260} = {CCA87CAB-F09E-45BB-B123-9002102C76DE}
- EndGlobalSection
EndGlobal
View
31 ReSharperExtensions.sln.DotSettings
@@ -0,0 +1,31 @@
+<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+
+
+
+
+
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/@KeyIndexDefined">True</s:Boolean>
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Applicability/=Live/@EntryIndexedValue">True</s:Boolean>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Description/@EntryValue">test</s:String>
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=DomainAndUsername/@KeyIndexDefined">True</s:Boolean>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=DomainAndUsername/Expression/@EntryValue">JoarOyenLiveTemplateMacros.DomainAndUsername()</s:String>
+ <s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=DomainAndUsername/Order/@EntryValue">1</s:Int64>
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=Test_005Fmethod_005Fname/@KeyIndexDefined">True</s:Boolean>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=Test_005Fmethod_005Fname/Expression/@EntryValue">JoarOyenLiveTemplateMacros.ValidIdentifier()</s:String>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=TestCategory/Expression/@EntryValue">list("Unit,Integration,Acceptance")</s:String>
+ <s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=Test_005Fmethod_005Fname/Order/@EntryValue">2</s:Int64>
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=TestCategory/@KeyIndexDefined">True</s:Boolean>
+ <s:Int64 x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Field/=TestCategory/Order/@EntryValue">0</s:Int64>
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Reformat/@EntryValue">True</s:Boolean>
+
+
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Scope/=C3001E7C0DA78E4487072B7E050D86C5/@KeyIndexDefined">True</s:Boolean>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Scope/=C3001E7C0DA78E4487072B7E050D86C5/CustomProperties/=minimumLanguageVersion/@EntryIndexedValue">4.0</s:String>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Scope/=C3001E7C0DA78E4487072B7E050D86C5/Type/@EntryValue">InCSharpFile</s:String>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Shortcut/@EntryValue">tm</s:String>
+ <s:Boolean x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/ShortenQualifiedReferences/@EntryValue">True</s:Boolean>
+ <s:String x:Key="/Default/PatternsAndTemplates/LiveTemplates/Template/=B7ADA03151419D4EB2F142E78E6692C4/Text/@EntryValue">[TestMethod, TestCategory("$TestCategory$"), Owner("$DomainAndUsername$")]
+public void $Test_method_name$()
+{
+ $END$
+}</s:String></wpf:ResourceDictionary>
View
6 ReSharperExtensions.vsmdi
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
- <TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
- <RunConfiguration id="b32d296d-a14d-43ca-8b1b-9ce26b6a0392" name="Local" storage="local.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- </TestList>
-</TestLists>
View
16 Templates/Live Templates/JoarOyen Templates.xml
@@ -1,16 +0,0 @@
-<TemplatesExport>
- <Template uid="0fb9eda3-89fa-4507-84c9-8d8b6847e66f" shortcut="tm" description="Creates an MS Test method" text="[TestMethod, TestCategory(&quot;$TestCategory$&quot;), Owner(&quot;$DomainAndUsername$&quot;)]&#xD;&#xA;public void $Test_method_name$()&#xD;&#xA;{&#xD;&#xA; $END$&#xD;&#xA;}" reformat="True" shortenQualifiedReferences="True">
- <Context>
- <CSharpContext context="TypeMember" minimumLanguageVersion="2.0" />
- </Context>
- <Categories>
- <Category name="MSTest" />
- </Categories>
- <Variables>
- <Variable name="DomainAndUsername" expression="JoarOyenLiveTemplateMacros.DomainAndUsername()" initialRange="-1" />
- <Variable name="TestCategory" expression="list(&quot;,Unit,Integration,AcceptanceInProgress,AcceptanceCompleted&quot;)" initialRange="0" />
- <Variable name="Test_method_name" expression="JoarOyenLiveTemplateMacros.ValidIdentifier()" initialRange="0" />
- </Variables>
- <CustomProperties />
- </Template>
-</TemplatesExport>
View
61 Templates/Templates.csproj
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B7FEC423-AA66-4568-8381-9D9A7042FE3B}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Templates</RootNamespace>
- <AssemblyName>Templates</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <TargetFrameworkProfile>Client</TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- <SccProjectName>
- </SccProjectName>
- <SccLocalPath>
- </SccLocalPath>
- <SccAuxPath>
- </SccAuxPath>
- <SccProvider>
- </SccProvider>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup>
- <StartupObject />
- </PropertyGroup>
- <ItemGroup>
- <Folder Include="File Templates\" />
- </ItemGroup>
- <ItemGroup>
- <Content Include="Live Templates\JoarOyen Templates.xml" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
67 Test/MSTestProject/MSTestProject.csproj
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{055A163B-EA7F-4195-A4D0-D522115AD6D4}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>MSTestProject</RootNamespace>
- <AssemblyName>MSTestProject</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <SccProjectName>
- </SccProjectName>
- <SccLocalPath>
- </SccLocalPath>
- <SccAuxPath>
- </SccAuxPath>
- <SccProvider>
- </SccProvider>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="UnitTest1.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
35 Test/MSTestProject/Properties/AssemblyInfo.cs
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("MSTestProject")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("MSTestProject")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("e137608a-24b4-4b48-b425-015f68d458dc")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
10 Test/MSTestProject/UnitTest1.cs
@@ -1,10 +0,0 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace MSTestProject
-{
- [TestClass]
- public class UnitTest1
- {
-
- }
-}
View
16 Test/Macros.Tests.Unit/AssemblyInitialize.cs
@@ -1,16 +0,0 @@
-using System;
-using System.Security.Principal;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace Macros.Tests.Unit
-{
- [TestClass]
- public class AssemblyInitialize
- {
- [AssemblyInitialize]
- public static void Initialize(TestContext context)
- {
- AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
- }
- }
-}
View
17 Test/Macros.Tests.Unit/DomainAndUsernameMacroTests.cs
@@ -1,17 +0,0 @@
-using JoarOyen.Tools.ReSharper.Macros;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace Macros.Tests.Unit
-{
- [TestClass]
- public class DomainAndUsernameMacroTests
- {
- private readonly DomainAndUsernameMacro _domainAndUsernameMacro = new DomainAndUsernameMacro();
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void Getting_the_current_domain_and_username_returns_an_non_empty_string()
- {
- Assert.IsFalse(string.IsNullOrEmpty(_domainAndUsernameMacro.QuickEvaluate(null)));
- }
- }
-}
View
80 Test/Macros.Tests.Unit/Macros.Tests.Unit.csproj
@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{614FD39A-6B4A-4A55-91E8-85C2E1D63260}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Macros.Tests.Unit</RootNamespace>
- <AssemblyName>Macros.Tests.Unit</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <SccProjectName>
- </SccProjectName>
- <SccLocalPath>
- </SccLocalPath>
- <SccAuxPath>
- </SccAuxPath>
- <SccProvider>
- </SccProvider>
- <TargetFrameworkProfile />
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="JetBrains.ReSharper.Feature.Services, Version=6.1.20.125, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\..\..\Program Files (x86)\JetBrains\ReSharper\v6.1\Bin\JetBrains.ReSharper.Feature.Services.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="AssemblyInitialize.cs" />
- <Compile Include="DomainAndUsernameMacroTests.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ValidIdentifierTests.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\Macros\Macros.csproj">
- <Project>{7D1A00EB-6067-4A94-B476-83B5DABFD0BD}</Project>
- <Name>Macros</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
View
35 Test/Macros.Tests.Unit/Properties/AssemblyInfo.cs
@@ -1,35 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("Macros.Tests.Unit")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("Macros.Tests.Unit")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("20a2d1a1-6a23-434a-903a-4c99563b4556")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
View
47 Test/Macros.Tests.Unit/ValidIdentifierTests.cs
@@ -1,47 +0,0 @@
-using JoarOyen.Tools.ReSharper.Macros;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace Macros.Tests.Unit
-{
- [TestClass]
- public class ValidIdentifierTests
- {
- readonly ValidIdentifierMacro _validIdentifierMacro = new ValidIdentifierMacro();
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void Empty_identifier_returns_empty()
- {
- Assert.AreEqual("", _validIdentifierMacro.QuickEvaluate(""));
- }
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void Valid_identifier_returns_an_unmodified_value()
- {
- Assert.AreEqual("This_is_a_valid_identifier42", _validIdentifierMacro.QuickEvaluate("This_is_a_valid_identifier42"));
- }
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void An_identifier_starting_with_a_number_is_prefixed_with_an_underscore()
- {
- Assert.AreEqual("_1InvalidIdentifier", _validIdentifierMacro.QuickEvaluate("1InvalidIdentifier"));
- }
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void An_identifier_starting_with_an_underscore_is_not_prefixed_with_another_underscore()
- {
- Assert.AreEqual("_1InvalidIdentifier", _validIdentifierMacro.QuickEvaluate("_1InvalidIdentifier"));
- }
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void Invalid_characters_in_an_identifier_is_replaced_with_underscores()
- {
- Assert.AreEqual("Invalid_identifier_____", _validIdentifierMacro.QuickEvaluate("Invalid identifier #/!-"));
- }
-
- [TestMethod, TestCategory("Unit"), Owner("HOME\\joaro")]
- public void Norwegian_characters_are_valid()
- {
- Assert.AreEqual("Valid_norwegian_identifier_æøåÆØÅ", _validIdentifierMacro.QuickEvaluate("Valid_norwegian_identifier_æøåÆØÅ"));
- }
- }
-}
View
21 TraceAndTestImpact.testsettings
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<TestSettings name="Trace and Test Impact" id="a285c354-b41b-4a87-b8f0-76daf17df5dd" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
- <Description>These are test settings for Trace and Test Impact.</Description>
- <Execution>
- <TestTypeSpecific />
- <AgentRule name="Execution Agents">
- <DataCollectors>
- <DataCollector uri="datacollector://microsoft/SystemInfo/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo.SystemInfoDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.SystemInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="System Information">
- </DataCollector>
- <DataCollector uri="datacollector://microsoft/ActionLog/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.ManualTest.ActionLog.ActionLogPlugin, Microsoft.VisualStudio.TestTools.ManualTest.ActionLog, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Actions">
- </DataCollector>
- <DataCollector uri="datacollector://microsoft/HttpProxy/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.HttpProxyCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Client Proxy for IntelliTrace and Test Impact">
- </DataCollector>
- <DataCollector uri="datacollector://microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Test Impact">
- </DataCollector>
- <DataCollector uri="datacollector://microsoft/TraceDebugger/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TraceDebuggerDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="IntelliTrace">
- </DataCollector>
- </DataCollectors>
- </AgentRule>
- </Execution>
-</TestSettings>

0 comments on commit 6185888

Please sign in to comment.
Something went wrong with that request. Please try again.