-
Notifications
You must be signed in to change notification settings - Fork 6
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 #55 from benpollarduk/no_color_env_support
Added NO_COLOR support
- Loading branch information
Showing
3 changed files
with
107 additions
and
3 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
BP.AdventureFramework.Tests/Rendering/Frames/GridTextFrame_Tests.cs
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,68 @@ | ||
using System; | ||
using BP.AdventureFramework.Rendering.Frames; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace BP.AdventureFramework.Tests.Rendering.Frames | ||
{ | ||
[TestClass] | ||
public class GridTextFrame_Tests | ||
{ | ||
[TestMethod] | ||
public void GivenUnmodifiedEnvironment_WhenIsColorSupressed_ThenReturnFalse() | ||
{ | ||
var result = GridTextFrame.IsColorSupressed(); | ||
|
||
Assert.IsFalse(result); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenNoColorEnvironmentVariableSetToEmptyString_WhenIsColorSupressed_ThenReturnFalse() | ||
{ | ||
Environment.SetEnvironmentVariable(GridTextFrame.NO_COLOR, ""); | ||
|
||
var result = GridTextFrame.IsColorSupressed(); | ||
|
||
Assert.IsFalse(result); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenNoColorEnvironmentVariableSetTo0_WhenIsColorSupressed_ThenReturnFalse() | ||
{ | ||
Environment.SetEnvironmentVariable(GridTextFrame.NO_COLOR, "0"); | ||
|
||
var result = GridTextFrame.IsColorSupressed(); | ||
|
||
Assert.IsFalse(result); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenNoColorEnvironmentVariableSetToFalse_WhenIsColorSupressed_ThenReturnFalse() | ||
{ | ||
Environment.SetEnvironmentVariable(GridTextFrame.NO_COLOR, "False"); | ||
|
||
var result = GridTextFrame.IsColorSupressed(); | ||
|
||
Assert.IsFalse(result); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenNoColorEnvironmentVariableSetTo1_WhenIsColorSupressed_ThenReturnTrue() | ||
{ | ||
Environment.SetEnvironmentVariable(GridTextFrame.NO_COLOR, "1"); | ||
|
||
var result = GridTextFrame.IsColorSupressed(); | ||
|
||
Assert.IsTrue(result); | ||
} | ||
|
||
[TestMethod] | ||
public void GivenNoColorEnvironmentVariableSetToTrue_WhenIsColorSupressed_ThenReturnTrue() | ||
{ | ||
Environment.SetEnvironmentVariable(GridTextFrame.NO_COLOR, "True"); | ||
|
||
var result = GridTextFrame.IsColorSupressed(); | ||
|
||
Assert.IsTrue(result); | ||
} | ||
} | ||
} |
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