Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
[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"));
}
}
@g0t4

This comment has been minimized.

Show comment Hide comment
@g0t4

g0t4 Jan 9, 2014

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

Owner

g0t4 commented Jan 9, 2014

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

@domartynov

This comment has been minimized.

Show comment Hide comment
@domartynov

domartynov Jun 16, 2014

Wes, what's the assert library used here? i mean the piece: Exepect(..., Is.EqualTo(...)) Thx

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