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
[Test] | |
public async void OneSimpleTest() | |
{ | |
var eightBall = new EightBall(); | |
var answer = await eightBall.ShouldIChangeJob(); | |
Assert.That(answer, Is.True); | |
// why am I still here? | |
} |
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
[Test] | |
public async Task OneSimpleTest() | |
{ | |
var eightBall = new EightBall(); | |
var answer = await eightBall.ShouldIChangeJob(); | |
Assert.That(answer, Is.True); | |
} |
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
[TestCase(1, 2, Result = 3)] | |
public async Task<int> TestAddAsync(int a, int b) | |
{ | |
return await SumAsync(a, b); | |
} | |
public async Task<int> SumAsync(int a, int b) | |
{ | |
return await Task.FromResult(a) + await Task.FromResult(b); | |
} |
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
[Test] | |
public async Task AsyncLambaSupport() | |
{ | |
// throwing asynchronously | |
Assert.That(async () => await ThrowAsync(), Throws.TypeOf<InvalidOperationException>()); | |
// returning values asynchronously | |
Assert.That(async () => await ReturnOneAsync(), Is.EqualTo(1)); | |
// "After" works with async methods too |
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
Console.WriteLine(Path.GetDirectoryName(@"c:\windows\temp")); // c:\windows | |
Console.WriteLine(Path.GetDirectoryName(@"c:\windows\temp\")); // c:\windows\temp !!! |
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
1 - Copy the file typescript.sublime-build in %appdata%\Sublime Text 2\Packages\User | |
2 - Edit a .ts file | |
- CTRL+B will compile to .js and save to the same path as the .ts file | |
- CTRL+SHIFT+B will compile to .js and create+run an HTML page which embeds the script |
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
<Query Kind="Program" /> | |
void Main() | |
{ | |
var tree = branch( | |
leaf("a"), | |
branch( | |
branch( | |
leaf("b"), | |
leaf("c")), |
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
<project name="Hello World" default="build" basedir="."> | |
<description>The Hello World of build files</description> | |
<property name="debug" value="true" overwrite="false" /> | |
<target name="build" description="greets you"> | |
<echo message="hey there" /> | |
</target> | |
</project> |
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
let stream; | |
let events = ['message', 'tweet', 'delete', 'limit', 'scrub_geo', 'disconnect', | |
'connect', 'connected', 'reconnect', 'warning', 'status_withheld', | |
'user_withheld', 'friends', 'direct_message', 'user_event']; | |
function start(path, params) { | |
if (stream) stream.stop(); | |
let T = new Twit({ |
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
void Main() | |
{ | |
new NUnitLite.Runner.TextUI().Execute(new[]{"-noheader"}); | |
} | |
// Define other methods and classes here | |
[Test] | |
public void SomeTest() | |
{ | |
Assert.Pass(); |