-
Notifications
You must be signed in to change notification settings - Fork 4
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 #6 from csMACnz/release-1.1.0
Release 1.1.0
- Loading branch information
Showing
41 changed files
with
1,836 additions
and
347 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ obj | |
*.userprefs | ||
*.user | ||
*.sln.DotSettings.user | ||
*.sln.ide | ||
|
||
# mstest test results | ||
TestResults | ||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="coveralls.net" version="0.4.0" /> | ||
<package id="coveralls.net" version="0.5.0" /> | ||
<package id="OpenCover" version="4.5.3522" /> | ||
<package id="PublishCoverity" version="0.9.0" /> | ||
<package id="xunit.runners" version="1.9.2" /> | ||
</packages> |
61 changes: 61 additions & 0 deletions
61
src/BCLExtensions.Tests/ActionExtensions/AsActionUsingTests.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,61 @@ | ||
using System; | ||
using Xunit; | ||
|
||
namespace BCLExtensions.Tests.ActionExtensions | ||
{ | ||
|
||
public class AsActionUsingTests | ||
{ | ||
[Fact] | ||
public void SampleActionIsValid() | ||
{ | ||
Assert.DoesNotThrow(() => SampleAction(42)); | ||
} | ||
|
||
[Fact] | ||
public void ResultNotNull() | ||
{ | ||
Action<int> function = SampleAction; | ||
|
||
var action = function.AsActionUsing(12); | ||
|
||
Assert.NotNull(action); | ||
} | ||
|
||
private void SampleAction(int parameter) | ||
{ | ||
|
||
} | ||
|
||
[Fact] | ||
public void InternalFunctionExecutes() | ||
{ | ||
bool internalFunctionWasCalled = false; | ||
Action<int> action = parameter => | ||
{ | ||
internalFunctionWasCalled = true; | ||
}; | ||
var result = action.AsActionUsing(12); | ||
result(); | ||
|
||
Assert.True(internalFunctionWasCalled); | ||
} | ||
|
||
|
||
[Fact] | ||
public void InternalFunctionCapturesCorrectParameter() | ||
{ | ||
const int expectedParameter = 12; | ||
int passedParameter = 0; | ||
Action<int> action = parameter => | ||
{ | ||
passedParameter = parameter; | ||
}; | ||
|
||
var result = action.AsActionUsing(expectedParameter); | ||
result(); | ||
|
||
Assert.Equal(expectedParameter, passedParameter); | ||
} | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
src/BCLExtensions.Tests/ActionExtensions/AsActionUsingWithThreeParametersTests.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,69 @@ | ||
using System; | ||
using Xunit; | ||
|
||
namespace BCLExtensions.Tests.ActionExtensions | ||
{ | ||
|
||
public class AsActionUsingWithThreeParametersTests | ||
{ | ||
[Fact] | ||
public void SampleActionIsValid() | ||
{ | ||
Assert.DoesNotThrow(() => SampleAction(42, "Test", true)); | ||
} | ||
|
||
[Fact] | ||
public void ResultNotNull() | ||
{ | ||
Action<int, string, bool> action = SampleAction; | ||
|
||
var result = action.AsActionUsing(12, "12", false); | ||
|
||
Assert.NotNull(result); | ||
} | ||
|
||
[Fact] | ||
public void InternalActionExecutes() | ||
{ | ||
bool internalActionWasCalled = false; | ||
Action<int, string, bool> action = (p1,p2,p3) => | ||
{ | ||
internalActionWasCalled = true; | ||
}; | ||
var result = action.AsActionUsing(12,"24", false); | ||
result(); | ||
|
||
Assert.True(internalActionWasCalled); | ||
} | ||
|
||
|
||
[Fact] | ||
public void InternalActionCapturesCorrectParameters() | ||
{ | ||
const int expectedParameter1 = 12; | ||
const string expectedParameter2 = "24"; | ||
const bool expectedParameter3 = true; | ||
int passedParameter1 = 0; | ||
string passedParameter2 = null; | ||
bool passedParameter3 = false; | ||
Action<int, string, bool> action = (p1,p2,p3) => | ||
{ | ||
passedParameter1 = p1; | ||
passedParameter2 = p2; | ||
passedParameter3 = p3; | ||
}; | ||
|
||
var result = action.AsActionUsing(expectedParameter1, expectedParameter2, expectedParameter3); | ||
result(); | ||
|
||
Assert.Equal(expectedParameter1, passedParameter1); | ||
Assert.Equal(expectedParameter2, passedParameter2); | ||
Assert.Equal(expectedParameter3, passedParameter3); | ||
} | ||
|
||
private void SampleAction(int parameter1, string parameter2, bool parameter3) | ||
{ | ||
} | ||
|
||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
src/BCLExtensions.Tests/ActionExtensions/AsActionUsingWithTwoParametersTests.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,65 @@ | ||
using System; | ||
using Xunit; | ||
|
||
namespace BCLExtensions.Tests.ActionExtensions | ||
{ | ||
|
||
public class AsActionUsingWithTwoParametersTests | ||
{ | ||
[Fact] | ||
public void SampleActionIsValid() | ||
{ | ||
Assert.DoesNotThrow(() => SampleAction(42, "Test")); | ||
} | ||
|
||
[Fact] | ||
public void ResultNotNull() | ||
{ | ||
Action<int, string> action = SampleAction; | ||
|
||
var result = action.AsActionUsing(12, "12"); | ||
|
||
Assert.NotNull(result); | ||
} | ||
|
||
[Fact] | ||
public void InternalActionExecutes() | ||
{ | ||
bool internalActionWasCalled = false; | ||
Action<int, string> action = (p1,p2) => | ||
{ | ||
internalActionWasCalled = true; | ||
}; | ||
var result = action.AsActionUsing(12,"24"); | ||
result(); | ||
|
||
Assert.True(internalActionWasCalled); | ||
} | ||
|
||
|
||
[Fact] | ||
public void InternalActionCapturesCorrectParameters() | ||
{ | ||
const int expectedParameter1 = 12; | ||
const string expectedParameter2 = "24"; | ||
int passedParameter1 = 0; | ||
string passedParameter2 = null; | ||
Action<int, string> action = (p1,p2) => | ||
{ | ||
passedParameter1 = p1; | ||
passedParameter2 = p2; | ||
}; | ||
|
||
var result = action.AsActionUsing(expectedParameter1, expectedParameter2); | ||
result(); | ||
|
||
Assert.Equal(expectedParameter1, passedParameter1); | ||
Assert.Equal(expectedParameter2, passedParameter2); | ||
} | ||
|
||
private void SampleAction(int parameter1, string parameter2) | ||
{ | ||
} | ||
|
||
} | ||
} |
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.