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
# duplicated to https://gist.github.com/awr/a5136e574556ed50ce94 for public access | |
# START http://boxstarter.org/package/url?https://gist.githubusercontent.com/awr/a5136e574556ed50ce94/raw/dev-boxstarter.ps1 | |
# chocolatey initial setup | |
choco feature enable -n=allowGlobalConfirmation -y | |
choco feature enable -n=autoUninstaller -y | |
# Windows setup | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
Disable-InternetExplorerESC |
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 LambdaComparer | |
{ | |
/// <summary> | |
/// Creates an <see cref="IEqualityComparer<T>"/> using the given <paramref name="equalsFunc"/> and a constant <see cref="IEqualityComparer<T>.GetHashCode(T)"/> function. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <param name="equalsFunc">A function to use for <see cref="IEqualityComparer<T>.Equals(T, T)"/></param> | |
/// <returns>An <see cref="IEqualityComparer<T>"/></returns> | |
/// <remarks>Since <see cref="IEqualityComparer<T>.GetHashCode(T)"/> will be constant, this comparer will not perform well on large sets. For performance |
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
@FunctionalInterface | |
public interface Assertion<TArg1, TArg2, TArg3> { | |
void Execute(TArg1 arg1, TArg2 arg2, TArg3 arg3); | |
} | |
public static Assertion<RestContextBase, RestRequest, RestResponse> CreatedWithJsonBody() { | |
return (RestContextBase context, RestRequest y, RestResponse z) -> { |
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
List<JsonNode> fieldNodes = FindingJsonHelper.getFields(finding, fieldKey); | |
if (fieldNodes.stream().noneMatch(fieldNode -> conditions.stream().allMatch(c -> c.evaluate(fieldNode)))) { | |
return false; | |
} |