-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ModernRonin/Refactoring
Refactoring
- Loading branch information
Showing
22 changed files
with
388 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using AutofacContrib.NSubstitute; | ||
using NSubstitute; | ||
using NUnit.Framework; | ||
|
||
namespace ModernRonin.ProjectRenamer.Tests | ||
{ | ||
[TestFixture] | ||
public class DotnetTests | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
{ | ||
_dependencies = new AutoSubstitute(); | ||
_underTest = _dependencies.Resolve<Dotnet>(); | ||
} | ||
|
||
AutoSubstitute _dependencies; | ||
Dotnet _underTest; | ||
|
||
IExecutor Executor => _dependencies.Resolve<IExecutor>(); | ||
|
||
[Test(Description = "fix for https://github.com/ModernRonin/ProjectRenamer/issues/24")] | ||
public void AddToSolution_replaces_forward_slashes_with_backward_slashes_in_solutionFolder() | ||
{ | ||
_underTest.AddToSolution("c:/myproject/myproject.csproj", "Features/.shared"); | ||
|
||
Executor.Received() | ||
.Tool("dotnet", @"sln add -s ""Features\.shared"" ""c:/myproject/myproject.csproj"""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using Autofac; | ||
using FluentAssertions; | ||
using NUnit.Framework; | ||
|
||
namespace ModernRonin.ProjectRenamer.Tests | ||
{ | ||
[TestFixture] | ||
public class RenamerModuleTests | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
{ | ||
var builder = new ContainerBuilder(); | ||
builder.RegisterModule<RenamerModule>(); | ||
_container = builder.Build(); | ||
} | ||
|
||
IContainer _container; | ||
|
||
[Test] | ||
public void Application_factory_can_be_resolved() | ||
{ | ||
var factory = _container.Resolve<Func<Configuration, string, Application>>(); | ||
factory.Should().NotBeNull(); | ||
factory(new Configuration(), string.Empty).Should().NotBeNull(); | ||
} | ||
|
||
[Test] | ||
public void IConfigurationSetup_can_be_resolved() | ||
{ | ||
_container.Resolve<IConfigurationSetup>().Should().NotBeNull(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.