Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public async Task WriteToFile_StreamsChanged()
using (var watcher = new ObservableFileSystemWatcher(c => { c.Path = TempPath; }))
var firstChanged = watcher.Changed.FirstAsync().ToTask();
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"));
Copy link

g0t4 commented Jan 9, 2014

This is a gist of this my post c# async/await makes reactive testing expressive!

Copy link

domartynov commented Jun 16, 2014

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