Skip to content

Instantly share code, notes, and snippets.

public delegate bool TrySomething(string key, out string result);
[Test]
public void Should_be_able_to_assign_out_and_ref()
{
var fake = A.Fake<TrySomething>();
string sample = null;
string expectedOut = "hello";
string result = null;
@blairconrad
blairconrad / SeflInitializedFake.cs
Last active September 29, 2016 18:51
SelfInitializedFakes
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace SelfInitializedFakes
{
using FakeItEasy;

Keybase proof

I hereby claim:

  • I am blairconrad on github.
  • I am blairconrad (https://keybase.io/blairconrad) on keybase.
  • I have a public key whose fingerprint is AEBB E24E D9E2 977B 77EA F60B 0958 0635 4B75 3431

To claim this, I am signing this object:

@blairconrad
blairconrad / appveyor.txt
Last active July 12, 2017 00:59
FakeItEasy appveyor.yml
version: '{build}'
image: Visual Studio 2017
pull_requests:
do_not_increment_build_number: true
environment:
BUILD: $(APPVEYOR_BUILD_NUMBER)
COVERITY_EMAIL:
secure: 9iw6ajDvltEymr75DhlRbH8X+2olJ8mbWLPqyYMmleg=
5413,5438d5412
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidException() [03] When a non-void method is called on the wrapper
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidException() [04] Then the real object's method is called
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidException() [05] And the wrapper throws the exception thrown by the real object's method
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidException() [06] And the exception stack trace is preserved
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidSuccess() [01] Given a real object
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidSuccess() [02] And a fake wrapping this object
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidSuccess() [03] When a non-void method is called on the wrapper
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidSuccess() [04] Then the real object's method is called
< Passed FakeItEasy.Specs.WrappingFakeSpecs.NonVoidSuccess() [05] And the wrapper returns the value returned by
--- .\crucible-orig.py 2018-08-16 13:38:18.101556600 -0400
+++ .\crucible.py 2018-09-17 16:40:00.600443200 -0400
@@ -651,20 +651,22 @@
else:
print('No reviewers added, review will be left in Draft state')
Console.success('Created review %(id)s (state: %(state)s) - %(url)s/cru/%(id)s'
% ({'id': review_id, 'state': review_state,'url':self.configuration.url}))
def add_patch_data(self, patch, request_dict={}):
import platform
import sys
import importlib
output = [
platform.platform(),
"Python " + sys.version,
]
for module in ("pydicom", "numpy", "PIL", "jpeg_ls", "gdcm"):
import platform
import sys
import importlib
output = [
platform.platform(),
"Python " + sys.version,
]
for module in ("pydicom", "numpy", "PIL", "imagecodecs", "gdcm"):
import pygal
from pygal.style import Style
# Define the style
custom_style = Style(
colors=("#0343df", "#e50000", "#ffff14", "#929591"),
font_family="Roboto,Helvetica,Arial,sans-serif",
background="transparent",
label_font_size=14,