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 AutoPropertyDataAttribute : DataAttribute | |
{ | |
private readonly string _propertyName; | |
private readonly Func<IFixture> _createFixture; | |
public AutoPropertyDataAttribute(string propertyName) | |
: this(propertyName, () => new Fixture()) | |
{ } | |
protected AutoPropertyDataAttribute(string propertyName, Func<IFixture> createFixture) |
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
container.RegisterRuntimeProxy<ITestGuard>(context => | |
new TestGuardSwitcher(() => | |
context.Ancestors().Any(x => x.ImplementationType == typeof(TestController)) | |
? new NullTestGuard() | |
: new OtherTestGuard()); | |
class TestGuardSwitcher : ITestGuard | |
{ | |
public TestGuardSwitcher(Func<ITestGuard> switcher) | |
{ |
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
let combine fs x y = Seq.fold (fun acc f -> acc || f x y) false fs | |
let matcher f (n, msg) i = | |
if f n i then | |
Some msg | |
else | |
None | |
module Option = | |
let combine op a b = |
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
use std::fs; | |
fn load_vec(path: &str) -> Vec<String> { | |
fs::read_to_string(path) | |
.expect("Could not read file") | |
.split('\n') | |
.map(|x| String::from(x)) | |
.collect() | |
} |