Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections;
using System.IO;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Newtonsoft.Json.Linq;
namespace pr_demo_2019.Tests.Helpers
{
@PaulRiviera
PaulRiviera / HttpRequestHelper.cs
Created December 19, 2019 21:36
These Files should all go into the Helpers Folder in the Unit Test Project
public static class HttpRequestHelper
{
public static HttpRequest CreateHttpRequest(
string method,
string uriString,
IHeaderDictionary headers = null,
object body = null)
{
var uri = new Uri(uriString);
var request = new DefaultHttpContext().Request;
@PaulRiviera
PaulRiviera / AccountEntity.cs
Created December 19, 2019 20:58
All these classes should be in the Domain Folder within the Function App Visual Studio Project
public class AccountEntity : BaseEntity
{
[JsonProperty("account_number")]
public string AccountNumber { get; set; }
[JsonProperty("system_of_record")]
public string SystemOfRecord { get; set; }
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }
public class RescheduleDateCalculateHttpTriggerTests : BaseTests
{
[Fact]
public async void When_Trigger()
{
// Arrange
var rescheduleDateCalculateOptions =
new RescheduleDateCalculateOptions();
public abstract class BaseTests
{
protected readonly ILogger _logger = LoggerHelper.CreateLogger(LoggerTypes.List);
protected readonly Faker _faker;
protected BaseTests()
{
_faker = new Bogus.Faker();
}
}
public class CaseNumberGenerateHttpTriggerTests : BaseTests
{
[Fact]
public void When_Trigger()
{
// Arrange
var httpRequest =
HttpRequestHelper.CreateHttpRequest(
"POST",
@PaulRiviera
PaulRiviera / NextPaymentDateCalculateHttpTrigger.cs
Last active December 19, 2019 21:00
Functions for Senario #3 and #4
public static class NextPaymentDateCalculateHttpTrigger
{
[FunctionName("NextPaymentDateCalculateHttpTrigger")]
public async static Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "post", Route = "payments/calculate/nextpaymentdate")] HttpRequest req,
ILogger log)
{
log.LogInformation("NextPaymentDateCalculateOptions function processed a request.");
var rescheduleDateCalculateOptions =
var plaid = require('plaid');
var moment = require('moment');
var documentClient = require("documentdb").DocumentClient;
var PLAID_CLIENT_ID = '{Your Plaid Client Id}';
var PLAID_SECRET = '{Your Plaid Secret}';
var PLAID_PUBLIC_KEY = '{Your Plaid Public Key}';
var PLAID_ENV = '{Plaid Enviorment: sandbox}';
var ACCESS_TOKEN = '{Plaid Access Token from Quickstart}'; //The Access token can be retrieved from the Plaid Quickstart
@PaulRiviera
PaulRiviera / MurMurHash3.cs
Created November 7, 2015 17:37 — forked from automatonic/MurMurHash3.cs
MurMurHash3 .Net (C#) implementation
/*
This code is public domain.
The MurmurHash3 algorithm was created by Austin Appleby and put into the public domain. See http://code.google.com/p/smhasher/
This C# variant was authored by
Elliott B. Edwards and was placed into the public domain as a gist
Status...Working on verification (Test Suite)
Set up to run as a LinqPad (linqpad.net) script (thus the ".Dump()" call)
*/