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
public class ImplicitConversionTest | |
{ | |
public class A | |
{ | |
public string Member { get; set; } | |
public static implicit operator string(A self) | |
{ | |
return self.Member; | |
} |
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
using NUnit.Framework; | |
namespace Spikes | |
{ | |
public class Foo | |
{ | |
public Foo(string name) | |
{ | |
Name = name; | |
} |
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
#include <iostream> | |
#include <map> | |
#include <algorithm> | |
#include <functional> | |
#include <memory> | |
using namespace std; | |
using namespace std::placeholders; | |
class receiver |
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
#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 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 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 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 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 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 static class AvatarUriExtensions | |
{ | |
public static string GetAvatarUri(this User user) | |
{ | |
return GetAvatarUri(user.AvatarUri, user.Email); | |
} | |
/// <summary> | |
/// Returns the uri or the Gravatar address as a fallback. | |
/// </summary> |
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
[TestFixture] | |
public class ConfirmAccount | |
{ | |
private const string _server = "http://www.example.com" | |
private const string _email = "foo@bar.com"; | |
private const string _password = "12345"; | |
private Client _client; | |
[SetUp] | |
public void SetUp() |
OlderNewer