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
using System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Runtime.CompilerServices; | |
using System.Threading.Tasks; | |
using AngleSharpWrappers; | |
using Bunit; | |
using Microsoft.AspNetCore.Components; | |
namespace ConsoleAppBUnit |
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
[FunctionName("ExecuteSmartContractFunction")] | |
public async Task<IActionResult> RunExecuteFunctionAsync( | |
[HttpTrigger(AuthorizationLevel.Function, "post")]HttpRequest req) | |
{ | |
_logger.LogInformation("ExecuteSmartContractFunction"); | |
string body = await req.ReadAsStringAsync(); | |
var request = JsonConvert.DeserializeObject<SmartContractFunctionRequest>(body); | |
try |
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
[FunctionName("QuerySmartContractFunction")] | |
public static async Task<IActionResult> RunQueryFunctionAsync( | |
[HttpTrigger(AuthorizationLevel.Function, "post")]HttpRequest req, | |
[Inject] ISmartContractService service, | |
ILogger logger) | |
{ | |
_logger.LogInformation("QuerySmartContractFunction"); | |
string body = await req.ReadAsStringAsync(); | |
var request = JsonConvert.DeserializeObject<SmartContractFunctionRequest>(body); |
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
[FunctionName("QuerySmartContractFunction")] | |
public async Task<IActionResult> RunQueryFunctionAsync( | |
[HttpTrigger(AuthorizationLevel.Function, "post")]HttpRequest req) | |
{ | |
_logger.LogInformation("RunDeployContract"); | |
string body = await req.ReadAsStringAsync(); | |
var request = JsonConvert.DeserializeObject<SmartContractDeployRequest>(body); | |
try |
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
pragma solidity >=0.5.2 <0.6.0; | |
contract SimpleStorageContract { | |
int private _version; | |
string private _description; | |
uint private _storedNumber; | |
string private _storedString; | |
constructor (int version, string memory description) 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
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.security.InvalidKeyException; | |
def hmac_sha256(String secretKey, String data) { | |
def mac = Mac.getInstance("HmacSHA256"); | |
def secretKeySpec = new SecretKeySpec(secretKey.getBytes(), "HmacSHA256"); | |
mac.init(secretKeySpec); | |
return mac.doFinal(data.getBytes()); |
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
using Microsoft.Extensions.Options; | |
using System; | |
using System.Configuration; | |
using System.Linq; | |
using System.Reflection; | |
namespace ConsoleApp | |
{ | |
public static class OptionsBuilderExtensions | |
{ |
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
using System; | |
using System.Linq; | |
using System.Reflection; | |
using JetBrains.Annotations; | |
// ReSharper disable once CheckNamespace | |
namespace AutoMapper | |
{ | |
public static class AutoMapperExtensions | |
{ |
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
# Build source, tests and run tests with coverage | |
- script: | | |
dotnet test ./test/MyTestProject.csproj -c Debug --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover | |
displayName: 'Build source, tests and run tests with coverage' | |
# Upload coverage to codecov.io | |
- script: | | |
%USERPROFILE%\.nuget\packages\codecov\1.1.0\tools\codecov.exe -f "./test/MyTestProject/coverage.opencover.xml" -t $(CODECOV_TOKEN) | |
displayName: Upload coverage to codecov.io |
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
<ItemGroup> | |
<PackageReference Include="Codecov" Version="1.1.0" /> | |
<!-- more pacakges here ... --> | |
</ItemGroup> |