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 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 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
[TestFixture] | |
public class ConfirmAccount | |
{ | |
private const string _server = "http://www.example.com" | |
private const string _email = "[email protected]"; | |
private const string _password = "12345"; | |
private Client _client; | |
[SetUp] | |
public void SetUp() |
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 <cpprest/json.h> | |
#include <sstream> | |
using namespace std; | |
typedef web::json::value JsonValue; | |
typedef web::json::value::value_type JsonValueType; | |
typedef std::wstring String; | |
typedef std::wstringstream StringStream; | |
String JsonValueTypeToString(const JsonValueType& type) |
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 <cpprest/json.h> | |
#include <sstream> | |
#include <cpprest/http_client.h> | |
#include <cpprest/filestream.h> | |
#include <iostream> | |
#include <map> | |
using namespace std; | |
using namespace web::http; | |
using namespace web::http::client; |
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 <stdio.h> | |
using namespace std; | |
[event_source(native)] | |
class Sender | |
{ | |
public: | |
__event void SendEvent(int 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
#include <iostream> | |
#include <map> | |
#include <algorithm> | |
#include <functional> | |
#include <memory> | |
using namespace std; | |
class EventArgs { | |
public: |
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
[TestFixture] | |
public class Deserialize_a_different_scheme | |
{ | |
[XmlType("Archive")] | |
public class Archive | |
{ | |
[XmlType("Person")] | |
[XmlInclude(typeof(Employee))] | |
public class Person | |
{ |
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 FeatureService | |
{ | |
public FeatureService(string accessToken) | |
{ | |
// .. ommited internals | |
} | |
[InjectionConstructor] // <-- This annotation makes you depend on the IoC container's implementation! | |
public FeatureService(IFeatureDependency dependency) | |
{ |
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 Getting_an_event_when_connecting_should_succeed() | |
{ | |
using (var ws = new ReactiveWebSocket("ws://127.0.0.1:8080", true)) | |
{ | |
var man = new WebSocketManager(ws); | |
man.Send(new Message { Id = Guid.NewGuid().ToString() }); |
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 SerializerTests | |
{ | |
public static IEnumerable<object[]> Serializers | |
{ | |
get | |
{ | |
yield return new object[] { new NewtonsoftJson() }; | |
yield return new object[] { new ServiceStackJson() }; | |
} | |
} |
OlderNewer