Last active
January 2, 2016 17:39
-
-
Save g0t4/8337974 to your computer and use it in GitHub Desktop.
This file contains hidden or 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] | |
[Timeout(2000)] | |
public async Task WriteToFile_StreamsChanged() | |
{ | |
using (var watcher = new ObservableFileSystemWatcher(c => { c.Path = TempPath; })) | |
{ | |
var firstChanged = watcher.Changed.FirstAsync().ToTask(); | |
watcher.Start(); | |
File.WriteAllText(Path.Combine(TempPath, "Changed.Txt"), "foo"); | |
var changed = await firstChanged; | |
Expect(changed.ChangeType, Is.EqualTo(WatcherChangeTypes.Changed)); | |
Expect(changed.Name, Is.EqualTo("Changed.Txt")); | |
} | |
} |
Wes, what's the assert library used here? i mean the piece: Exepect(..., Is.EqualTo(...)) Thx
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a gist of this my post c# async/await makes reactive testing expressive!