-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
816 additions
and
76 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
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,83 @@ | ||
namespace Cake.Npm.Tests.Ci | ||
{ | ||
using Cake.Npm.Ci; | ||
using Shouldly; | ||
using System; | ||
using Xunit; | ||
|
||
public sealed class NpmUpdateSettingsExtensionsTests | ||
{ | ||
public sealed class TheForProductionMethod | ||
{ | ||
[Fact] | ||
public void Should_Throw_If_Settings_Are_Null() | ||
{ | ||
// Given | ||
NpmCiSettings settings = null; | ||
|
||
// When | ||
var result = Record.Exception(() => settings.ForProduction()); | ||
|
||
// Then | ||
result.IsArgumentNullException("settings"); | ||
} | ||
[Fact] | ||
public void Should_Set_Production() | ||
{ | ||
// Given | ||
var settings = new NpmCiSettings(); | ||
|
||
// When | ||
settings.ForProduction(); | ||
|
||
// Then | ||
settings.Production.ShouldBe(true); | ||
} | ||
} | ||
|
||
public sealed class TheFromRegistryMethod | ||
{ | ||
[Fact] | ||
public void Should_Throw_If_Settings_Are_Null() | ||
{ | ||
// Given | ||
NpmCiSettings settings = null; | ||
var registry = new Uri("https://myregistry.com"); | ||
|
||
// When | ||
var result = Record.Exception(() => settings.FromRegistry(registry)); | ||
|
||
// Then | ||
result.IsArgumentNullException("settings"); | ||
} | ||
|
||
[Fact] | ||
public void Should_Throw_If_Registry_Is_Null() | ||
{ | ||
// Given | ||
var settings = new NpmCiSettings(); | ||
Uri registry = null; | ||
|
||
// When | ||
var result = Record.Exception(() => settings.FromRegistry(registry)); | ||
|
||
// Then | ||
result.IsArgumentNullException("registry"); | ||
} | ||
|
||
[Fact] | ||
public void Should_Set_Registry() | ||
{ | ||
// Given | ||
var settings = new NpmCiSettings(); | ||
var registry = new Uri("https://myregistry.com"); | ||
|
||
// When | ||
var result = settings.FromRegistry(registry); | ||
|
||
// Then | ||
result.Registry.ShouldBe(registry); | ||
} | ||
} | ||
} | ||
} |
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.