Skip to content

Instantly share code, notes, and snippets.

@nyctef
Created December 13, 2015 21:47
Show Gist options
  • Save nyctef/9e2fb9b0683e9438ec18 to your computer and use it in GitHub Desktop.
Save nyctef/9e2fb9b0683e9438ec18 to your computer and use it in GitHub Desktop.
fun with DNX and FluentAssertions
C:\git\slackist\Slackist.Tests [master ↑ +0 ~2 -0 !]> dnx test -method Tests.CanConnectToSlack
xUnit.net DNX Runner (64-bit DNXCore 5.0)
Discovering: Slackist.Tests
Discovered: Slackist.Tests
Starting: Slackist.Tests
Tests.CanConnectToSlack [FAIL]
Expected string not to be <null> because we need an API token to connect to slack.
Stack Trace:
C:\projects\fluentassertions-vf06b\Src\Shared\Execution\LateBoundTestFramework.cs(26,0): at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
C:\projects\fluentassertions-vf06b\Src\Core\Execution\AssertionScope.cs(197,0): at FluentAssertions.Execution.AssertionScope.FailWith(String message, Object[] args)
C:\projects\fluentassertions-vf06b\Src\Core\Primitives\ReferenceTypeAssertions.cs(58,0): at FluentAssertions.Primitives.ReferenceTypeAssertions`2.NotBeNull(String because, Object[] reasonArgs)
C:\git\slackist\Slackist.Tests\BasicTests.cs(30,0): at Tests.<CanConnectToSlack>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Finished: Slackist.Tests
=== TEST EXECUTION SUMMARY ===
Slackist.Tests Total: 1, Errors: 0, Failed: 1, Skipped: 0, Time: 0.125s
class Tests
{
[Fact]
public async Task CanConnectToSlack()
{
var cts = new CancellationTokenSource();
var token = cts.Token;
// TODO LATER: some config system
var slackApiToken = Environment.GetEnvironmentVariable("SLACK_TOKEN");
slackApiToken.Should().NotBeNull("we need an API token to connect to slack");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment