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
| [Fact] | |
| public async Task When_awaiting_null_it_should_throw() | |
| { | |
| try | |
| { | |
| Task t1 = Task.Run(() => { /* do nothing */ }); | |
| Task t2 = null; | |
| await Task.WhenAll(t1, t2); | |
| Assert.True(false, "Should have thrown before!"); | |
| } |
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
| public class MyTests | |
| { | |
| public class Package { } | |
| public class Service | |
| { | |
| public IObservable<Package> DeliverRegular() | |
| { | |
| return DeliverRegularAsync().ToObservable(); | |
| } |
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
| public class LoginExplorations | |
| { | |
| public async Task<DataContracts.List[]> FetchListsAsync(string accessToken, string deviceId) | |
| { | |
| var info = new TestSystemInfo( | |
| userAgent: "Wunderlist.Sdk/" + new AssemblyInfoHelper(typeof (RestClient)).AssemblyVersion, | |
| clientId: "01d4f9dcdafd531da497", | |
| clientProductGitHash: new AssemblyInfoHelper(typeof (RestClient)).InformationalVersion, | |
| clientDeviceId: deviceId, | |
| clientSystem: "Windows RT device", |
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
| namespace Sandbox | |
| { | |
| public class ExampleViewModel : ViewModelBase | |
| { | |
| public string Title | |
| { | |
| get { return GetValue(() => Title); } | |
| set { SetValue(() => Title, value); } | |
| } | |
| } |
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
| namespace VisitorTests | |
| { | |
| public interface INt | |
| { | |
| } | |
| public interface INtel | |
| { | |
| } |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel; | |
| using System.Diagnostics; | |
| using System.Linq.Expressions; | |
| namespace Playground { | |
| // Notice the 3 occurrencies of the Title identifier and the abscence of additional backing fields! | |
| public class ExampleViewModel : ViewModelBase { | |
| public string Title { |
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
| public class WorkerCancellationTests | |
| { | |
| [Test] | |
| public async Task When_running_async_then_result_should_be_true() | |
| { | |
| var worker = new Worker(); | |
| var result = await worker.DoAsync(100.Milliseconds()); | |
| result.Should().BeTrue(); | |
| } |
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
| public class RxPlayground | |
| { | |
| public static class MyReactiveExtensions | |
| { | |
| public static IObservable<T> ToCancellable<T>(this IObservable<T> source, CancellationToken cancellationToken) | |
| { | |
| var obj = new ThrowWhenCancelled<T>(source); | |
| cancellationToken.Register(obj.Cancel); | |
| return obj.ToObservable(); | |
| } |
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
| #include <iostream> | |
| #include <string> | |
| #include "boost/date_time/local_time/local_time.hpp" | |
| #include "boost/date_time/c_local_time_adjustor.hpp" | |
| boost::posix_time::time_duration get_utc_offset(const boost::posix_time::ptime& time_stamp) | |
| { | |
| using boost::posix_time::ptime; | |
| const ptime local_time = boost::date_time::c_local_adjustor<ptime>::utc_to_local(time_stamp); | |
| return local_time - time_stamp; |
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
| #include <iostream> | |
| #include <map> | |
| #include <algorithm> | |
| #include <functional> | |
| #include <memory> | |
| using namespace std; | |
| using namespace std::placeholders; | |
| class receiver |