├── JavaOddOrEven ├── host.json ├── .settings │ ├── org.eclipse.jdt.apt.core.prefs │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── .vscode │ ├── extensions.json │ ├── settings.json │ ├── launch.json │ └── tasks.json ├── extensions.csproj ├── .gitignore ├── .project ├── src │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── function │ │ │ ├── OddOrEven.java │ │ │ └── OddOrEvenQueue.java │ └── test │ │ └── java │ │ └── com │ │ └── function │ │ ├── OddOrEvenQueueTest.java │ │ └── OddOrEvenTest.java ├── .classpath └── pom.xml ├── JavaScriptOddOrEven ├── host.json ├── .vscode │ ├── extensions.json │ ├── settings.json │ ├── launch.json │ └── tasks.json ├── OddOrEvenQueue │ ├── function.json │ └── index.js ├── .gitignore ├── OddOrEven │ ├── function.json │ └── index.js ├── package.json ├── test │ ├── test-results.xml │ ├── oddOrEvenTest.js │ └── oddOrEvenQueueTest.js └── package-lock.json ├── CSharpOddOrEven ├── CSharpOddOrEven │ ├── host.json │ ├── local.settings.json │ ├── CSharpOddOrEven.csproj │ ├── OddOrEven.cs │ ├── OddOrEvenQueue.cs │ └── .gitignore ├── CSharpOddOrEvent.Tests │ ├── MockHttpMessageHandler.cs │ ├── DataClass.cs │ ├── CSharpOddOrEven.Tests.csproj │ ├── FunctionTestLogger.cs │ ├── OddOrEvenTest.cs │ └── OddOrEvenQueueTest.cs ├── getKeys.ps1 ├── CSharpOddOrEven.sln └── Function.runsettings ├── README.md └── .gitignore /JavaOddOrEven/host.json: -------------------------------------------------------------------------------- 1 | { 2 | } 3 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/host.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven/host.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /JavaOddOrEven/.settings/org.eclipse.jdt.apt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.apt.aptEnabled=false 3 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /JavaOddOrEven/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /JavaOddOrEven/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "ms-azuretools.vscode-azurefunctions", 4 | "vscjava.vscode-java-debug" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /JavaOddOrEven/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/test/java=UTF-8 4 | encoding/=UTF-8 5 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.projectRuntime": "beta", 3 | "azureFunctions.projectLanguage": "JavaScript", 4 | "azureFunctions.templateFilter": "Verified", 5 | "cSpell.words": [ 6 | "moxios" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /JavaOddOrEven/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "azureFunctions.projectRuntime": "beta", 3 | "azureFunctions.projectLanguage": "Java", 4 | "azureFunctions.templateFilter": "Verified", 5 | "java.configuration.updateBuildConfiguration": "interactive" 6 | } 7 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/OddOrEvenQueue/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "disabled": false, 3 | "bindings": [ 4 | { 5 | "name": "myNumber", 6 | "type": "queueTrigger", 7 | "direction": "in", 8 | "queueName": "numbers", 9 | "connection": "AzureWebJobsStorage" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | csx 4 | .vs 5 | edge 6 | Publish 7 | 8 | *.user 9 | *.suo 10 | *.cscfg 11 | *.Cache 12 | project.lock.json 13 | 14 | /packages 15 | /TestResults 16 | 17 | /tools/NuGet.exe 18 | /App_Data 19 | /secrets 20 | /data 21 | .secrets 22 | appsettings.json 23 | local.settings.json 24 | -------------------------------------------------------------------------------- /JavaOddOrEven/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to Java Functions", 6 | "type": "java", 7 | "request": "attach", 8 | "hostName": "localhost", 9 | "port": 5005, 10 | "preLaunchTask": "runFunctionsHost" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to JavaScript Functions", 6 | "type": "node", 7 | "request": "attach", 8 | "port": 5858, 9 | "protocol": "inspector", 10 | "preLaunchTask": "runFunctionsHost" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure Functions Test Samples 2 | 3 | The following repo has some basic examples of test strategies for Azure Functions. Follow the folder to a function project in the specified language, and see how unit tests and mocks can be used to validate Azure Functions. 4 | 5 | [Read more in the blog series on Medium.com](https://medium.com/@jeffhollan/serverless-devops-and-ci-cd-part-1-f76f0357cba4) -------------------------------------------------------------------------------- /JavaOddOrEven/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 3 | org.eclipse.jdt.core.compiler.compliance=1.8 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.processAnnotations=disabled 6 | org.eclipse.jdt.core.compiler.release=disabled 7 | org.eclipse.jdt.core.compiler.source=1.8 8 | -------------------------------------------------------------------------------- /JavaOddOrEven/extensions.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | ** 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/OddOrEven/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "disabled": false, 3 | "bindings": [ 4 | { 5 | "authLevel": "function", 6 | "type": "httpTrigger", 7 | "direction": "in", 8 | "name": "req", 9 | "methods": [ 10 | "get", 11 | "post" 12 | ] 13 | }, 14 | { 15 | "type": "http", 16 | "direction": "out", 17 | "name": "res" 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /JavaOddOrEven/.gitignore: -------------------------------------------------------------------------------- 1 | # Build output 2 | target/ 3 | *.class 4 | 5 | # Log file 6 | *.log 7 | 8 | # BlueJ files 9 | *.ctxt 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | # IDE 26 | .idea/ 27 | *.iml 28 | 29 | # macOS 30 | .DS_Store 31 | 32 | # Azure Functions 33 | local.settings.json 34 | bin/ 35 | obj/ 36 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/OddOrEven/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (context, req) { 2 | context.log('JavaScript Odd or Even triggered - HTTP.'); 3 | 4 | if (req.query.number && parseInt(req.query.number)) { 5 | context.res = { 6 | status: 200, 7 | body: parseInt(req.query.number) % 2 == 0 ? "Even" : "Odd" 8 | } 9 | } 10 | else { 11 | context.res = { 12 | status: 400, 13 | body: `Unable to parse the query parameter 'number'. Got value: ${req.query.number}` 14 | } 15 | } 16 | 17 | context.done(); 18 | }; -------------------------------------------------------------------------------- /JavaOddOrEven/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JavaOddOrEven 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEvent.Tests/MockHttpMessageHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | 5 | namespace CSharpOddOrEven.Tests 6 | { 7 | public class MockHttpMessageHandler : HttpMessageHandler 8 | { 9 | public virtual HttpResponseMessage Send(HttpRequestMessage request) 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | 14 | protected override Task SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) 15 | { 16 | return Task.FromResult(Send(request)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/OddOrEvenQueue/index.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | 3 | module.exports = async function (context, myNumber) { 4 | context.log('JavaScript Odd or even trigger fired - Queue'); 5 | 6 | if (myNumber && parseInt(myNumber)) { 7 | if(parseInt(myNumber) % 2 == 0) { 8 | context.log('Was even'); 9 | await axios.post('https://importantapi.com/api/transaction','Even'); 10 | } 11 | else { 12 | context.log('Was odd'); 13 | await axios.post('https://importantapi.com/api/transaction', 'Odd'); 14 | } 15 | } 16 | else { 17 | throw new Error(`Unable to parse the queue message. Got value: ${myNumber}`) 18 | } 19 | }; -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven/CSharpOddOrEven.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | PreserveNewest 16 | Never 17 | 18 | 19 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEvent.Tests/DataClass.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Numerics; 3 | 4 | namespace CSharpOddOrEven.Tests 5 | { 6 | public class Numbers 7 | { 8 | public static IEnumerable EvenNumbers => 9 | new List 10 | { 11 | new object[] { (BigInteger)2 }, 12 | new object[] { (BigInteger)0 }, 13 | new object[] { (BigInteger)2000000000000 }, 14 | }; 15 | 16 | 17 | public static IEnumerable OddNumbers => 18 | new List 19 | { 20 | new object[] { (BigInteger)3 }, 21 | new object[] { (BigInteger)1 }, 22 | new object[] { (BigInteger)2000000000001 }, 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Run Functions Host", 6 | "identifier": "runFunctionsHost", 7 | "type": "shell", 8 | "command": "func host start", 9 | "options": { 10 | "env": { 11 | "languageWorkers:node:arguments": "--inspect=5858" 12 | } 13 | }, 14 | "isBackground": true, 15 | "presentation": { 16 | "reveal": "always" 17 | }, 18 | "problemMatcher": [ 19 | { 20 | "owner": "azureFunctions", 21 | "pattern": [ 22 | { 23 | "regexp": "\\b\\B", 24 | "file": 1, 25 | "location": 2, 26 | "message": 3 27 | } 28 | ], 29 | "background": { 30 | "activeOnStart": true, 31 | "beginsPattern": "^.*Stopping host.*", 32 | "endsPattern": "^.*Job host started.*" 33 | } 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascriptoddoreven", 3 | "version": "1.0.0", 4 | "description": "Test sample for Azure Functions", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "mocha test --reporter mocha-junit-reporter --reporter-options mochaFile=./test/test-results.xml", 8 | "test-local": "mocha test" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/jeffhollan/functions-test-samples.git" 13 | }, 14 | "keywords": [ 15 | "serverless", 16 | "test", 17 | "azure", 18 | "functions" 19 | ], 20 | "author": "Jeff Hollan", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/jeffhollan/functions-test-samples/issues" 24 | }, 25 | "homepage": "https://github.com/jeffhollan/functions-test-samples#readme", 26 | "dependencies": { 27 | "axios": "^0.18.0" 28 | }, 29 | "devDependencies": { 30 | "mocha": "^5.2.0", 31 | "mocha-junit-reporter": "^1.17.0", 32 | "moxios": "^0.4.0", 33 | "sinon": "^6.1.4" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEvent.Tests/CSharpOddOrEven.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.1 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven/OddOrEven.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.Azure.WebJobs; 3 | using Microsoft.Azure.WebJobs.Extensions.Http; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.Extensions.Logging; 6 | using System.Numerics; 7 | 8 | namespace CSharpOddOrEven 9 | { 10 | public static class OddOrEven 11 | { 12 | [FunctionName("OddOrEven")] 13 | public static IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")]HttpRequest req, ILogger log) 14 | { 15 | log.LogInformation("Odd or even trigger fired - HTTP"); 16 | 17 | string numberQueryValue = req.Query["number"]; 18 | 19 | if (BigInteger.TryParse(numberQueryValue, out BigInteger number)) 20 | { 21 | return new OkObjectResult(number % 2 == 0 ? "Even" : "Odd"); 22 | } 23 | else 24 | { 25 | return new BadRequestObjectResult($"Unable to parse the query parameter 'number'. Got value: {numberQueryValue}"); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CSharpOddOrEven/getKeys.ps1: -------------------------------------------------------------------------------- 1 | Param( 2 | [string]$appName, 3 | [string]$functionName, 4 | [string]$resourceGroup 5 | ) 6 | 7 | $publish = Invoke-AzureRmResourceAction -ResourceGroupName $resourceGroup -ResourceType Microsoft.Web/sites/config -ResourceName "$($appName)/publishingcredentials" -Action list -ApiVersion 2015-08-01 -Force 8 | $username = $publish.properties.publishingUserName 9 | $password = $publish.properties.publishingPassword 10 | $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password))) 11 | 12 | $scmUrl = "https://$($siteName).scm.azurewebsites.net" 13 | $token = Invoke-RestMethod -Uri "https://$($appName).scm.azurewebsites.net/api/functions/admin/token" -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)} -Method GET 14 | $keyResponse = Invoke-RestMethod -Uri "https://$($appName).azurewebsites.net/admin/functions/$($functionName)/keys" -Headers @{Authorization=("Bearer {0}" -f $token)} -Method GET 15 | $key = $keyResponse.keys[0].value 16 | 17 | Write-Host "##vso[task.setvariable variable=functionUrl;isSecret=false;isOutput=true;]https://$($appName).azurewebsites.net/api/$($functionName)&code=$($key)" -------------------------------------------------------------------------------- /JavaScriptOddOrEven/test/test-results.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JavaOddOrEven/src/main/java/com/function/OddOrEven.java: -------------------------------------------------------------------------------- 1 | package com.function; 2 | 3 | import java.util.*; 4 | import com.microsoft.azure.functions.annotation.*; 5 | import com.microsoft.azure.functions.*; 6 | 7 | /** 8 | * Azure Functions with HTTP Trigger. 9 | */ 10 | public class OddOrEven { 11 | 12 | @FunctionName("HttpTrigger-Java") 13 | public HttpResponseMessage HttpTriggerJava( 14 | @HttpTrigger(name = "req", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request, 15 | final ExecutionContext context) { 16 | try { 17 | context.getLogger().info("Java HTTP trigger processed a request."); 18 | 19 | String numberQueryValue = request.getQueryParameters().get("number"); 20 | int number = Integer.parseInt(numberQueryValue); 21 | 22 | return request 23 | .createResponseBuilder(HttpStatus.OK) 24 | .body(number % 2 == 0 ? "Even" : "Odd") 25 | .build(); 26 | } 27 | catch(NumberFormatException nfe) { 28 | return request 29 | .createResponseBuilder(HttpStatus.BAD_REQUEST) 30 | .body("Unable to parse") 31 | .build(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEvent.Tests/FunctionTestLogger.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using Microsoft.Extensions.Logging.Abstractions.Internal; 3 | using System; 4 | using System.Collections.Generic; 5 | using Xunit.Abstractions; 6 | 7 | namespace CSharpOddOrEven.Tests 8 | { 9 | class FunctionTestLogger : ILogger 10 | { 11 | private IList logs; 12 | private ITestOutputHelper output; 13 | public FunctionTestLogger(ITestOutputHelper output) 14 | { 15 | logs = new List(); 16 | this.output = output; 17 | } 18 | 19 | /// 20 | public IDisposable BeginScope(TState state) 21 | { 22 | return NullScope.Instance; 23 | } 24 | 25 | /// 26 | public bool IsEnabled(LogLevel logLevel) 27 | { 28 | return false; 29 | } 30 | 31 | /// 32 | public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter) 33 | { 34 | string message = formatter(state, exception); 35 | logs.Add(message); 36 | output.WriteLine(message); 37 | } 38 | 39 | public IList getLogs() 40 | { 41 | return logs; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven/OddOrEvenQueue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Numerics; 4 | using System.Threading.Tasks; 5 | using Microsoft.Azure.WebJobs; 6 | using Microsoft.Extensions.Logging; 7 | 8 | namespace CSharpOddOrEven 9 | { 10 | public static class OddOrEvenQueue 11 | { 12 | public static HttpClient client = new HttpClient(); 13 | 14 | [FunctionName("OddOrEvenQueue")] 15 | public static async Task RunAsync( 16 | [QueueTrigger("numbers", Connection = "AzureWebJobsStorage")]string myNumber, 17 | ILogger log) 18 | { 19 | log.LogInformation($"Odd or even trigger fired - Queue"); 20 | 21 | if (BigInteger.TryParse(myNumber, out BigInteger number)) 22 | { 23 | if (number % 2 == 0) 24 | { 25 | log.LogInformation("Was even"); 26 | await client.PostAsync("https://importantapi.com/api/transaction", new StringContent("Even")); 27 | } 28 | else 29 | { 30 | log.LogInformation("Was odd"); 31 | await client.PostAsync("https://importantapi.com/api/transaction", new StringContent("Odd")); 32 | } 33 | } 34 | else 35 | { 36 | throw new ArgumentException($"Unable to parse the queue message. Got value: {myNumber}"); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/test/oddOrEvenTest.js: -------------------------------------------------------------------------------- 1 | var assert = require('assert'); 2 | var oddOrEven = require('../OddOrEven/index'); 3 | 4 | var context; 5 | 6 | describe('OddOrEven', function() { 7 | before(function() { 8 | context = getContextObject(); 9 | }); 10 | describe('IsEven', function() { 11 | it('should return even', function() { 12 | context.done = function() { 13 | assert.equal(this.res.status, 200); 14 | assert.equal(this.res.body, "Even"); 15 | } 16 | oddOrEven(context, { query: {number: "2"}}); 17 | }); 18 | }); 19 | describe('IsOdd', function() { 20 | it('should return odd', function () { 21 | context.done = function() { 22 | assert.equal(this.res.status, 200); 23 | assert.equal(this.res.body, "Odd"); 24 | } 25 | oddOrEven(context, { query: {number: "3"}}); 26 | }); 27 | }); 28 | describe('IsNeither', function() { 29 | it('should return error', function() { 30 | context.done = function() { 31 | assert.equal(this.res.status, 400); 32 | assert.equal(this.res.body, "Unable to parse the query parameter 'number'. Got value: I'm Even"); 33 | } 34 | oddOrEven(context, { query: {number: "I'm Even"}}); 35 | }); 36 | }); 37 | }); 38 | 39 | function getContextObject() { 40 | return { 41 | res: null, 42 | log: function() { 43 | console.log(arguments[0]); 44 | }, 45 | done: null 46 | } 47 | } -------------------------------------------------------------------------------- /JavaOddOrEven/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Run Functions Host", 6 | "identifier": "runFunctionsHost", 7 | "linux": { 8 | "command": "sh -c \"mvn clean package -B && func host start --language-worker -- \\\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005\\\" --script-root \\\"target/azure-functions/odd-or-even-java-dev/\\\"\"" 9 | }, 10 | "osx": { 11 | "command": "sh -c \"mvn clean package -B && func host start --language-worker -- \\\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005\\\" --script-root \\\"target/azure-functions/odd-or-even-java-dev/\\\"\"" 12 | }, 13 | "windows": { 14 | "command": "powershell -command \"mvn clean package -B; func host start --language-worker -- \\\"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005\\\" --script-root \\\"target/azure-functions/odd-or-even-java-dev/\\\"\"" 15 | }, 16 | "type": "shell", 17 | "isBackground": true, 18 | "presentation": { 19 | "reveal": "always" 20 | }, 21 | "problemMatcher": [ 22 | { 23 | "owner": "azureFunctions", 24 | "pattern": [ 25 | { 26 | "regexp": "\\b\\B", 27 | "file": 1, 28 | "location": 2, 29 | "message": 3 30 | } 31 | ], 32 | "background": { 33 | "activeOnStart": true, 34 | "beginsPattern": "^.*Scanning for projects.*", 35 | "endsPattern": "^.*Job host started.*" 36 | } 37 | } 38 | ] 39 | } 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /JavaOddOrEven/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27924.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpOddOrEven", "CSharpOddOrEven\CSharpOddOrEven.csproj", "{F6663A05-E9E7-4E38-B77D-9A9ED4DD565C}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CSharpOddOrEven.Tests", "CSharpOddOrEvent.Tests\CSharpOddOrEven.Tests.csproj", "{94827959-F300-4E4C-A48C-B256A175CCC1}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2DE0E628-9BAC-456D-A8F3-0D9ABA6E37C7}" 11 | ProjectSection(SolutionItems) = preProject 12 | Function.runsettings = Function.runsettings 13 | getKeys.ps1 = getKeys.ps1 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 18 | Debug|Any CPU = Debug|Any CPU 19 | Release|Any CPU = Release|Any CPU 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {F6663A05-E9E7-4E38-B77D-9A9ED4DD565C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {F6663A05-E9E7-4E38-B77D-9A9ED4DD565C}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {F6663A05-E9E7-4E38-B77D-9A9ED4DD565C}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {F6663A05-E9E7-4E38-B77D-9A9ED4DD565C}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {94827959-F300-4E4C-A48C-B256A175CCC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {94827959-F300-4E4C-A48C-B256A175CCC1}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {94827959-F300-4E4C-A48C-B256A175CCC1}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {94827959-F300-4E4C-A48C-B256A175CCC1}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {540E3805-D427-429D-B775-853492EDE6A1} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEvent.Tests/OddOrEvenTest.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Http.Internal; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Extensions.Logging; 5 | using Microsoft.Extensions.Logging.Abstractions; 6 | using Microsoft.Extensions.Primitives; 7 | using System.Collections.Generic; 8 | using System.Numerics; 9 | using Xunit; 10 | 11 | namespace CSharpOddOrEven.Tests 12 | { 13 | public class OddOrEvenTests 14 | { 15 | private readonly ILogger logger = NullLoggerFactory.Instance.CreateLogger("Test"); 16 | 17 | [Theory] 18 | [MemberData(nameof(Numbers.EvenNumbers), MemberType = typeof(Numbers))] 19 | public void EvenNumber(BigInteger number) 20 | { 21 | var request = GenerateHttpRequest(number); 22 | var response = OddOrEven.Run(request, logger); 23 | 24 | Assert.IsType(response); 25 | Assert.Equal("Even", ((OkObjectResult)response).Value as string); 26 | } 27 | 28 | [Theory] 29 | [MemberData(nameof(Numbers.OddNumbers), MemberType = typeof(Numbers))] 30 | public void OddNumber(BigInteger number) 31 | { 32 | var request = GenerateHttpRequest(number); 33 | var response = OddOrEven.Run(request, logger); 34 | 35 | Assert.IsType(response); 36 | Assert.Equal("Odd", ((OkObjectResult)response).Value as string); 37 | } 38 | 39 | [Fact] 40 | public void NonNumbers() 41 | { 42 | string nonNumber = "I'm Even"; 43 | 44 | var request = GenerateHttpRequest(nonNumber); 45 | var response = OddOrEven.Run(request, logger); 46 | 47 | Assert.IsType(response); 48 | Assert.Contains("Unable to parse", ((BadRequestObjectResult)response).Value as string); 49 | } 50 | 51 | private DefaultHttpRequest GenerateHttpRequest(object number) 52 | { 53 | var request = new DefaultHttpRequest(new DefaultHttpContext()); 54 | var queryParams = new Dictionary() { { "number", number.ToString() } }; 55 | request.Query = new QueryCollection(queryParams); 56 | return request; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /JavaOddOrEven/src/main/java/com/function/OddOrEvenQueue.java: -------------------------------------------------------------------------------- 1 | package com.function; 2 | 3 | import com.microsoft.azure.functions.annotation.*; 4 | 5 | import org.apache.http.client.ClientProtocolException; 6 | import org.apache.http.client.methods.*; 7 | import org.apache.http.entity.*; 8 | import org.apache.http.impl.client.*; 9 | 10 | import java.io.IOException; 11 | import java.io.UnsupportedEncodingException; 12 | import java.util.logging.Logger; 13 | 14 | import com.microsoft.azure.functions.*; 15 | 16 | /** 17 | * Azure Functions with Azure Storage Queue trigger. 18 | */ 19 | public class OddOrEvenQueue { 20 | 21 | public static CloseableHttpClient client = HttpClients.createDefault(); 22 | /** 23 | * This function will be invoked when a new message is received at the specified path. The message contents are provided as input to this function. 24 | * @throws IOException 25 | * @throws ClientProtocolException 26 | */ 27 | @FunctionName("OddOrEvenQueue") 28 | public void queueHandler( 29 | @QueueTrigger(name = "myNumber", queueName = "numbers", connection = "AzureWebJobsStorage") String myNumber, 30 | final ExecutionContext context 31 | ) throws NumberFormatException, ClientProtocolException, IOException { 32 | try 33 | { 34 | context.getLogger().info("Java Odd or Even Queue trigger function processed a message."); 35 | int number = Integer.parseInt(myNumber); 36 | 37 | if(number % 2 == 0) 38 | { 39 | context.getLogger().info("Was even"); 40 | HttpPost httpPost = new HttpPost("http://importantapi.com/api/transaction"); 41 | httpPost.setEntity(new StringEntity("Even")); 42 | CloseableHttpResponse response = client.execute(httpPost); 43 | response.close(); 44 | } 45 | else 46 | { 47 | context.getLogger().info("Was odd"); 48 | HttpPost httpPost = new HttpPost("http://importantapi.com/api/transaction"); 49 | httpPost.setEntity(new StringEntity("Odd")); 50 | CloseableHttpResponse response = client.execute(httpPost); 51 | } 52 | } 53 | catch(Exception e) 54 | { 55 | throw e; 56 | } 57 | finally 58 | { 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/test/oddOrEvenQueueTest.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const axios = require('axios'); 3 | const moxios = require('moxios'); 4 | const sinon = require('sinon'); 5 | 6 | 7 | const oddOrEvenQueue = require('../OddOrEvenQueue/index'); 8 | 9 | var context; 10 | 11 | describe('OddOrEvenQueue', function() { 12 | before(function() { 13 | context = getContextObject(); 14 | }); 15 | beforeEach(() => moxios.install()); 16 | afterEach(() => moxios.uninstall()); 17 | 18 | describe('IsEven', function() { 19 | it('should return even', async function() { 20 | moxios.wait(function () { 21 | let request = moxios.requests.mostRecent(); 22 | assert.equal(request.config.data, "Even"); 23 | request.respondWith({ 24 | status: 200 25 | }); 26 | }); 27 | 28 | return await oddOrEvenQueue(context, "2").catch((reason) => {console.log(reason)}); 29 | }); 30 | }); 31 | describe('IsOdd', function() { 32 | it('should return odd', async function () { 33 | moxios.wait(function () { 34 | let request = moxios.requests.mostRecent(); 35 | assert.equal(request.config.data, "Odd"); 36 | request.respondWith({ 37 | status: 200 38 | }); 39 | }); 40 | 41 | return await oddOrEvenQueue(context, "3").catch((reason) => {console.log(reason)}); 42 | }); 43 | }); 44 | describe('IsNeither', function() { 45 | it('should return error',async function() { 46 | moxios.wait(function () { 47 | let request = moxios.requests.mostRecent(); 48 | request.respondWith({ 49 | status: 500 50 | }); 51 | }); 52 | 53 | // I'm not sure of a better way to assert on a Promise exception 54 | // But would love to know 👍 55 | 56 | try { 57 | await oddOrEvenQueue(context, "I'm Even"); 58 | assert.equal(1, 2); 59 | } 60 | catch(e) { 61 | assert.equal(1, 1); 62 | } 63 | }); 64 | }); 65 | }); 66 | 67 | function getContextObject() { 68 | return { 69 | res: null, 70 | log: function() { 71 | console.log(arguments[0]); 72 | }, 73 | done: null 74 | } 75 | } -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEvent.Tests/OddOrEvenQueueTest.cs: -------------------------------------------------------------------------------- 1 | using Moq; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Numerics; 7 | using System.Threading.Tasks; 8 | using Xunit; 9 | using Xunit.Abstractions; 10 | 11 | namespace CSharpOddOrEven.Tests 12 | { 13 | public class OddOrEvenQueueTest 14 | { 15 | private readonly ITestOutputHelper output; 16 | private Mock mockHttpMessageHandler; 17 | private HttpRequestMessage request; 18 | 19 | public OddOrEvenQueueTest(ITestOutputHelper output) 20 | { 21 | mockHttpMessageHandler = new Mock { CallBase = true }; 22 | this.output = output; 23 | 24 | mockHttpMessageHandler 25 | .Setup( 26 | m => m.Send(It.IsAny())) 27 | .Returns( 28 | new HttpResponseMessage 29 | { 30 | StatusCode = System.Net.HttpStatusCode.OK, 31 | Content = null 32 | }) 33 | .Callback(request => this.request = request); 34 | 35 | OddOrEvenQueue.client = new HttpClient(mockHttpMessageHandler.Object); 36 | } 37 | 38 | [Theory] 39 | [MemberData(nameof(Numbers.EvenNumbers), MemberType = typeof(Numbers))] 40 | public async Task EvenNumberAsync(BigInteger number) 41 | { 42 | FunctionTestLogger logger = new FunctionTestLogger(output); 43 | 44 | await OddOrEvenQueue.RunAsync(number.ToString(), logger); 45 | 46 | var wasEven = (from l in logger.getLogs() 47 | where l.Equals("Was even") 48 | select l).Any(); 49 | 50 | Assert.True(wasEven); 51 | 52 | Assert.Equal("Even", await request.Content.ReadAsStringAsync()); 53 | } 54 | 55 | [Theory] 56 | [MemberData(nameof(Numbers.OddNumbers), MemberType = typeof(Numbers))] 57 | public async Task OddNumberAsync(BigInteger number) 58 | { 59 | FunctionTestLogger logger = new FunctionTestLogger(output); 60 | 61 | await OddOrEvenQueue.RunAsync(number.ToString(), logger); 62 | 63 | var wasOdd = (from l in logger.getLogs() 64 | where l.Equals("Was odd") 65 | select l).Any(); 66 | 67 | Assert.True(wasOdd); 68 | 69 | Assert.Equal("Odd", await request.Content.ReadAsStringAsync()); 70 | 71 | } 72 | 73 | [Fact] 74 | public void NonNumbers() 75 | { 76 | string nonNumber = "I'm Even"; 77 | FunctionTestLogger logger = new FunctionTestLogger(output); 78 | 79 | Assert.ThrowsAsync(async () => 80 | await OddOrEvenQueue.RunAsync(nonNumber, logger) 81 | ); 82 | 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /JavaOddOrEven/src/test/java/com/function/OddOrEvenQueueTest.java: -------------------------------------------------------------------------------- 1 | package com.function; 2 | 3 | import org.apache.http.client.methods.CloseableHttpResponse; 4 | import org.apache.http.client.methods.HttpPost; 5 | import org.apache.http.impl.client.CloseableHttpClient; 6 | import org.junit.Test; 7 | import static org.mockito.Mockito.*; 8 | 9 | import com.microsoft.azure.functions.*; 10 | 11 | import java.io.BufferedReader; 12 | import java.io.InputStreamReader; 13 | import java.util.logging.Logger; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | import static org.mockito.ArgumentMatchers.any; 17 | import static org.mockito.Mockito.doReturn; 18 | import static org.mockito.Mockito.mock; 19 | 20 | 21 | /** 22 | * Unit test for OddOrEven class. 23 | */ 24 | public class OddOrEvenQueueTest { 25 | /** 26 | * Unit test for even numbers. 27 | */ 28 | @Test 29 | public void testEvenNumbers() throws Exception { 30 | CloseableHttpClient client = mock(CloseableHttpClient.class); 31 | CloseableHttpResponse res = mock(CloseableHttpResponse.class); 32 | doReturn(res).when(client).execute(any()); 33 | 34 | OddOrEvenQueue.client = client; 35 | 36 | OddOrEvenQueue function = new OddOrEvenQueue(); 37 | function.queueHandler("2", generateContext()); 38 | 39 | verify(client).execute(argThat(h -> { 40 | try 41 | { 42 | HttpPost req = (HttpPost)h; 43 | BufferedReader reader = new BufferedReader(new InputStreamReader(req.getEntity().getContent())); 44 | String content = reader.readLine(); 45 | assertEquals("Even", content); 46 | return true; 47 | } 48 | catch (Exception e) 49 | { 50 | return false; 51 | } 52 | })); 53 | } 54 | 55 | @Test 56 | public void testOddNumbers() throws Exception { 57 | CloseableHttpClient client = mock(CloseableHttpClient.class); 58 | CloseableHttpResponse res = mock(CloseableHttpResponse.class); 59 | doReturn(res).when(client).execute(any()); 60 | 61 | OddOrEvenQueue.client = client; 62 | 63 | OddOrEvenQueue function = new OddOrEvenQueue(); 64 | function.queueHandler("3", generateContext()); 65 | 66 | verify(client).execute(argThat(h -> { 67 | try 68 | { 69 | HttpPost req = (HttpPost)h; 70 | BufferedReader reader = new BufferedReader(new InputStreamReader(req.getEntity().getContent())); 71 | String content = reader.readLine(); 72 | assertEquals("Odd", content); 73 | return true; 74 | } 75 | catch (Exception e) 76 | { 77 | return false; 78 | } 79 | })); 80 | } 81 | 82 | @Test(expected = NumberFormatException.class) 83 | public void testNonNumbers() throws Exception { 84 | OddOrEvenQueue function = new OddOrEvenQueue(); 85 | function.queueHandler("I'm Even", generateContext()); 86 | } 87 | 88 | private ExecutionContext generateContext() 89 | { 90 | final ExecutionContext context = mock(ExecutionContext.class); 91 | doReturn(Logger.getGlobal()).when(context).getLogger(); 92 | 93 | return context; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /JavaOddOrEven/src/test/java/com/function/OddOrEvenTest.java: -------------------------------------------------------------------------------- 1 | package com.function; 2 | 3 | import org.junit.Test; 4 | import org.mockito.internal.matchers.InstanceOf; 5 | 6 | import static org.mockito.Mockito.*; 7 | 8 | import com.microsoft.azure.functions.*; 9 | 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import java.util.Optional; 13 | import java.util.logging.Logger; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | import static org.junit.Assert.assertSame; 17 | import static org.mockito.ArgumentMatchers.any; 18 | import static org.mockito.ArgumentMatchers.anyString; 19 | import static org.mockito.Mockito.doReturn; 20 | import static org.mockito.Mockito.mock; 21 | 22 | 23 | /** 24 | * Unit test for OddOrEven class. 25 | */ 26 | public class OddOrEvenTest { 27 | /** 28 | * Unit test for even numbers. 29 | */ 30 | @Test 31 | public void testEvenNumbers() throws Exception { 32 | // Setup 33 | 34 | final Map queryParams = new HashMap<>(); 35 | queryParams.put("number", "2"); 36 | 37 | final HttpResponseMessage.Builder builder = mock(HttpResponseMessage.Builder.class); 38 | 39 | HttpRequestMessage> req = generateHttpRequest(queryParams, builder); 40 | ExecutionContext context = generateContext(); 41 | 42 | // Invoke 43 | new OddOrEven().HttpTriggerJava(req, context); 44 | 45 | verify(builder).body("Even"); 46 | verify(req).createResponseBuilder(HttpStatus.OK); 47 | } 48 | 49 | @Test 50 | public void testOddNumbers() throws Exception { 51 | // Setup 52 | 53 | final Map queryParams = new HashMap<>(); 54 | queryParams.put("number", "3"); 55 | 56 | final HttpResponseMessage.Builder builder = mock(HttpResponseMessage.Builder.class); 57 | 58 | HttpRequestMessage> req = generateHttpRequest(queryParams, builder); 59 | ExecutionContext context = generateContext(); 60 | 61 | // Invoke 62 | new OddOrEven().HttpTriggerJava(req, context); 63 | 64 | verify(builder).body("Odd"); 65 | verify(req).createResponseBuilder(HttpStatus.OK); 66 | } 67 | 68 | @Test 69 | public void testNonNumber() throws Exception { 70 | // Setup 71 | 72 | final Map queryParams = new HashMap<>(); 73 | queryParams.put("number", "I'm Even"); 74 | 75 | final HttpResponseMessage.Builder builder = mock(HttpResponseMessage.Builder.class); 76 | 77 | HttpRequestMessage> req = generateHttpRequest(queryParams, builder); 78 | ExecutionContext context = generateContext(); 79 | 80 | // Invoke 81 | new OddOrEven().HttpTriggerJava(req, context); 82 | 83 | verify(builder).body("Unable to parse"); 84 | verify(req).createResponseBuilder(HttpStatus.BAD_REQUEST); 85 | } 86 | 87 | private HttpRequestMessage> generateHttpRequest(Map queryParams, HttpResponseMessage.Builder builder) { 88 | 89 | final HttpRequestMessage> req = mock(HttpRequestMessage.class); 90 | doReturn(queryParams).when(req).getQueryParameters(); 91 | 92 | final Optional queryBody = Optional.empty(); 93 | doReturn(queryBody).when(req).getBody(); 94 | 95 | doReturn(builder).when(req).createResponseBuilder(any(HttpStatus.class)); 96 | doReturn(builder).when(builder).body(anyString()); 97 | 98 | final HttpResponseMessage res = mock(HttpResponseMessage.class); 99 | doReturn(res).when(builder).build(); 100 | 101 | return req; 102 | } 103 | 104 | private ExecutionContext generateContext() 105 | { 106 | final ExecutionContext context = mock(ExecutionContext.class); 107 | doReturn(Logger.getGlobal()).when(context).getLogger(); 108 | 109 | return context; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /CSharpOddOrEven/CSharpOddOrEven/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | 5 | # User-specific files 6 | *.suo 7 | *.user 8 | *.userosscache 9 | *.sln.docstates 10 | 11 | # User-specific files (MonoDevelop/Xamarin Studio) 12 | *.userprefs 13 | 14 | # Build results 15 | [Dd]ebug/ 16 | [Dd]ebugPublic/ 17 | [Rr]elease/ 18 | [Rr]eleases/ 19 | x64/ 20 | x86/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | [Ll]og/ 25 | 26 | # Visual Studio 2015 cache/options directory 27 | .vs/ 28 | # Uncomment if you have tasks that create the project's static files in wwwroot 29 | #wwwroot/ 30 | 31 | # MSTest test Results 32 | [Tt]est[Rr]esult*/ 33 | [Bb]uild[Ll]og.* 34 | 35 | # NUNIT 36 | *.VisualState.xml 37 | TestResult.xml 38 | 39 | # Build Results of an ATL Project 40 | [Dd]ebugPS/ 41 | [Rr]eleasePS/ 42 | dlldata.c 43 | 44 | # DNX 45 | project.lock.json 46 | project.fragment.lock.json 47 | artifacts/ 48 | 49 | *_i.c 50 | *_p.c 51 | *_i.h 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opendb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | *.VC.db 86 | *.VC.VC.opendb 87 | 88 | # Visual Studio profiler 89 | *.psess 90 | *.vsp 91 | *.vspx 92 | *.sap 93 | 94 | # TFS 2012 Local Workspace 95 | $tf/ 96 | 97 | # Guidance Automation Toolkit 98 | *.gpState 99 | 100 | # ReSharper is a .NET coding add-in 101 | _ReSharper*/ 102 | *.[Rr]e[Ss]harper 103 | *.DotSettings.user 104 | 105 | # JustCode is a .NET coding add-in 106 | .JustCode 107 | 108 | # TeamCity is a build add-in 109 | _TeamCity* 110 | 111 | # DotCover is a Code Coverage Tool 112 | *.dotCover 113 | 114 | # NCrunch 115 | _NCrunch_* 116 | .*crunch*.local.xml 117 | nCrunchTemp_* 118 | 119 | # MightyMoose 120 | *.mm.* 121 | AutoTest.Net/ 122 | 123 | # Web workbench (sass) 124 | .sass-cache/ 125 | 126 | # Installshield output folder 127 | [Ee]xpress/ 128 | 129 | # DocProject is a documentation generator add-in 130 | DocProject/buildhelp/ 131 | DocProject/Help/*.HxT 132 | DocProject/Help/*.HxC 133 | DocProject/Help/*.hhc 134 | DocProject/Help/*.hhk 135 | DocProject/Help/*.hhp 136 | DocProject/Help/Html2 137 | DocProject/Help/html 138 | 139 | # Click-Once directory 140 | publish/ 141 | 142 | # Publish Web Output 143 | *.[Pp]ublish.xml 144 | *.azurePubxml 145 | # TODO: Comment the next line if you want to checkin your web deploy settings 146 | # but database connection strings (with potential passwords) will be unencrypted 147 | #*.pubxml 148 | *.publishproj 149 | 150 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 151 | # checkin your Azure Web App publish settings, but sensitive information contained 152 | # in these scripts will be unencrypted 153 | PublishScripts/ 154 | 155 | # NuGet Packages 156 | *.nupkg 157 | # The packages folder can be ignored because of Package Restore 158 | **/packages/* 159 | # except build/, which is used as an MSBuild target. 160 | !**/packages/build/ 161 | # Uncomment if necessary however generally it will be regenerated when needed 162 | #!**/packages/repositories.config 163 | # NuGet v3's project.json files produces more ignoreable files 164 | *.nuget.props 165 | *.nuget.targets 166 | 167 | # Microsoft Azure Build Output 168 | csx/ 169 | *.build.csdef 170 | 171 | # Microsoft Azure Emulator 172 | ecf/ 173 | rcf/ 174 | 175 | # Windows Store app package directories and files 176 | AppPackages/ 177 | BundleArtifacts/ 178 | Package.StoreAssociation.xml 179 | _pkginfo.txt 180 | 181 | # Visual Studio cache files 182 | # files ending in .cache can be ignored 183 | *.[Cc]ache 184 | # but keep track of directories ending in .cache 185 | !*.[Cc]ache/ 186 | 187 | # Others 188 | ClientBin/ 189 | ~$* 190 | *~ 191 | *.dbmdl 192 | *.dbproj.schemaview 193 | *.jfm 194 | *.pfx 195 | *.publishsettings 196 | node_modules/ 197 | orleans.codegen.cs 198 | 199 | # Since there are multiple workflows, uncomment next line to ignore bower_components 200 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 201 | #bower_components/ 202 | 203 | # RIA/Silverlight projects 204 | Generated_Code/ 205 | 206 | # Backup & report files from converting an old project file 207 | # to a newer Visual Studio version. Backup files are not needed, 208 | # because we have git ;-) 209 | _UpgradeReport_Files/ 210 | Backup*/ 211 | UpgradeLog*.XML 212 | UpgradeLog*.htm 213 | 214 | # SQL Server files 215 | *.mdf 216 | *.ldf 217 | 218 | # Business Intelligence projects 219 | *.rdl.data 220 | *.bim.layout 221 | *.bim_*.settings 222 | 223 | # Microsoft Fakes 224 | FakesAssemblies/ 225 | 226 | # GhostDoc plugin setting file 227 | *.GhostDoc.xml 228 | 229 | # Node.js Tools for Visual Studio 230 | .ntvs_analysis.dat 231 | 232 | # Visual Studio 6 build log 233 | *.plg 234 | 235 | # Visual Studio 6 workspace options file 236 | *.opt 237 | 238 | # Visual Studio LightSwitch build output 239 | **/*.HTMLClient/GeneratedArtifacts 240 | **/*.DesktopClient/GeneratedArtifacts 241 | **/*.DesktopClient/ModelManifest.xml 242 | **/*.Server/GeneratedArtifacts 243 | **/*.Server/ModelManifest.xml 244 | _Pvt_Extensions 245 | 246 | # Paket dependency manager 247 | .paket/paket.exe 248 | paket-files/ 249 | 250 | # FAKE - F# Make 251 | .fake/ 252 | 253 | # JetBrains Rider 254 | .idea/ 255 | *.sln.iml 256 | 257 | # CodeRush 258 | .cr/ 259 | 260 | # Python Tools for Visual Studio (PTVS) 261 | __pycache__/ 262 | *.pyc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | 56 | # StyleCop 57 | StyleCopReport.xml 58 | 59 | # Files built by Visual Studio 60 | *_i.c 61 | *_p.c 62 | *_i.h 63 | *.ilk 64 | *.meta 65 | *.obj 66 | *.iobj 67 | *.pch 68 | *.pdb 69 | *.ipdb 70 | *.pgc 71 | *.pgd 72 | *.rsp 73 | *.sbr 74 | *.tlb 75 | *.tli 76 | *.tlh 77 | *.tmp 78 | *.tmp_proj 79 | *.log 80 | *.vspscc 81 | *.vssscc 82 | .builds 83 | *.pidb 84 | *.svclog 85 | *.scc 86 | 87 | # Chutzpah Test files 88 | _Chutzpah* 89 | 90 | # Visual C++ cache files 91 | ipch/ 92 | *.aps 93 | *.ncb 94 | *.opendb 95 | *.opensdf 96 | *.sdf 97 | *.cachefile 98 | *.VC.db 99 | *.VC.VC.opendb 100 | 101 | # Visual Studio profiler 102 | *.psess 103 | *.vsp 104 | *.vspx 105 | *.sap 106 | 107 | # Visual Studio Trace Files 108 | *.e2e 109 | 110 | # TFS 2012 Local Workspace 111 | $tf/ 112 | 113 | # Guidance Automation Toolkit 114 | *.gpState 115 | 116 | # ReSharper is a .NET coding add-in 117 | _ReSharper*/ 118 | *.[Rr]e[Ss]harper 119 | *.DotSettings.user 120 | 121 | # JustCode is a .NET coding add-in 122 | .JustCode 123 | 124 | # TeamCity is a build add-in 125 | _TeamCity* 126 | 127 | # DotCover is a Code Coverage Tool 128 | *.dotCover 129 | 130 | # AxoCover is a Code Coverage Tool 131 | .axoCover/* 132 | !.axoCover/settings.json 133 | 134 | # Visual Studio code coverage results 135 | *.coverage 136 | *.coveragexml 137 | 138 | # NCrunch 139 | _NCrunch_* 140 | .*crunch*.local.xml 141 | nCrunchTemp_* 142 | 143 | # MightyMoose 144 | *.mm.* 145 | AutoTest.Net/ 146 | 147 | # Web workbench (sass) 148 | .sass-cache/ 149 | 150 | # Installshield output folder 151 | [Ee]xpress/ 152 | 153 | # DocProject is a documentation generator add-in 154 | DocProject/buildhelp/ 155 | DocProject/Help/*.HxT 156 | DocProject/Help/*.HxC 157 | DocProject/Help/*.hhc 158 | DocProject/Help/*.hhk 159 | DocProject/Help/*.hhp 160 | DocProject/Help/Html2 161 | DocProject/Help/html 162 | 163 | # Click-Once directory 164 | publish/ 165 | 166 | # Publish Web Output 167 | *.[Pp]ublish.xml 168 | *.azurePubxml 169 | # Note: Comment the next line if you want to checkin your web deploy settings, 170 | # but database connection strings (with potential passwords) will be unencrypted 171 | *.pubxml 172 | *.publishproj 173 | 174 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 175 | # checkin your Azure Web App publish settings, but sensitive information contained 176 | # in these scripts will be unencrypted 177 | PublishScripts/ 178 | 179 | # NuGet Packages 180 | *.nupkg 181 | # The packages folder can be ignored because of Package Restore 182 | **/[Pp]ackages/* 183 | # except build/, which is used as an MSBuild target. 184 | !**/[Pp]ackages/build/ 185 | # Uncomment if necessary however generally it will be regenerated when needed 186 | #!**/[Pp]ackages/repositories.config 187 | # NuGet v3's project.json files produces more ignorable files 188 | *.nuget.props 189 | *.nuget.targets 190 | 191 | # Microsoft Azure Build Output 192 | csx/ 193 | *.build.csdef 194 | 195 | # Microsoft Azure Emulator 196 | ecf/ 197 | rcf/ 198 | 199 | # Windows Store app package directories and files 200 | AppPackages/ 201 | BundleArtifacts/ 202 | Package.StoreAssociation.xml 203 | _pkginfo.txt 204 | *.appx 205 | 206 | # Visual Studio cache files 207 | # files ending in .cache can be ignored 208 | *.[Cc]ache 209 | # but keep track of directories ending in .cache 210 | !*.[Cc]ache/ 211 | 212 | # Others 213 | ClientBin/ 214 | ~$* 215 | *~ 216 | *.dbmdl 217 | *.dbproj.schemaview 218 | *.jfm 219 | *.pfx 220 | *.publishsettings 221 | orleans.codegen.cs 222 | 223 | # Including strong name files can present a security risk 224 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 225 | #*.snk 226 | 227 | # Since there are multiple workflows, uncomment next line to ignore bower_components 228 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 229 | #bower_components/ 230 | 231 | # RIA/Silverlight projects 232 | Generated_Code/ 233 | 234 | # Backup & report files from converting an old project file 235 | # to a newer Visual Studio version. Backup files are not needed, 236 | # because we have git ;-) 237 | _UpgradeReport_Files/ 238 | Backup*/ 239 | UpgradeLog*.XML 240 | UpgradeLog*.htm 241 | ServiceFabricBackup/ 242 | *.rptproj.bak 243 | 244 | # SQL Server files 245 | *.mdf 246 | *.ldf 247 | *.ndf 248 | 249 | # Business Intelligence projects 250 | *.rdl.data 251 | *.bim.layout 252 | *.bim_*.settings 253 | *.rptproj.rsuser 254 | 255 | # Microsoft Fakes 256 | FakesAssemblies/ 257 | 258 | # GhostDoc plugin setting file 259 | *.GhostDoc.xml 260 | 261 | # Node.js Tools for Visual Studio 262 | .ntvs_analysis.dat 263 | node_modules/ 264 | 265 | # Visual Studio 6 build log 266 | *.plg 267 | 268 | # Visual Studio 6 workspace options file 269 | *.opt 270 | 271 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 272 | *.vbw 273 | 274 | # Visual Studio LightSwitch build output 275 | **/*.HTMLClient/GeneratedArtifacts 276 | **/*.DesktopClient/GeneratedArtifacts 277 | **/*.DesktopClient/ModelManifest.xml 278 | **/*.Server/GeneratedArtifacts 279 | **/*.Server/ModelManifest.xml 280 | _Pvt_Extensions 281 | 282 | # Paket dependency manager 283 | .paket/paket.exe 284 | paket-files/ 285 | 286 | # FAKE - F# Make 287 | .fake/ 288 | 289 | # JetBrains Rider 290 | .idea/ 291 | *.sln.iml 292 | 293 | # CodeRush 294 | .cr/ 295 | 296 | # Python Tools for Visual Studio (PTVS) 297 | __pycache__/ 298 | *.pyc 299 | 300 | # Cake - Uncomment if you are using it 301 | # tools/** 302 | # !tools/packages.config 303 | 304 | # Tabs Studio 305 | *.tss 306 | 307 | # Telerik's JustMock configuration file 308 | *.jmconfig 309 | 310 | # BizTalk build output 311 | *.btp.cs 312 | *.btm.cs 313 | *.odx.cs 314 | *.xsd.cs 315 | 316 | # OpenCover UI analysis results 317 | OpenCover/ 318 | 319 | # Azure Stream Analytics local run output 320 | ASALocalRun/ 321 | 322 | # MSBuild Binary and Structured Log 323 | *.binlog 324 | 325 | # NVidia Nsight GPU debugger configuration file 326 | *.nvuser 327 | 328 | # MFractors (Xamarin productivity tool) working folder 329 | .mfractor/ 330 | 331 | # Local History for Visual Studio 332 | .localhistory/ 333 | local.settings.json 334 | .DS_Store 335 | -------------------------------------------------------------------------------- /JavaOddOrEven/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.function 7 | JavaOddOrEven 8 | 1.0-SNAPSHOT 9 | jar 10 | 11 | Azure Java Functions 12 | 13 | 14 | UTF-8 15 | 1.8 16 | 1.8 17 | 1.0.0-beta-4 18 | 1.0.0-beta-5 19 | odd-or-even-java-dev 20 | westus 21 | ${project.build.directory}/azure-functions/${functionAppName} 22 | java-functions-group 23 | 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.12 31 | 32 | 33 | org.mockito 34 | mockito-core 35 | 2.4.0 36 | 37 | 38 | com.microsoft.azure.functions 39 | azure-functions-java-library 40 | ${azure.functions.java.library.version} 41 | 42 | 43 | 44 | 45 | 46 | 47 | com.microsoft.azure.functions 48 | azure-functions-java-library 49 | 50 | 51 | 52 | org.apache.httpcomponents 53 | httpclient 54 | 4.5.6 55 | 56 | 57 | 58 | 59 | junit 60 | junit 61 | test 62 | 63 | 64 | org.mockito 65 | mockito-core 66 | test 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | com.microsoft.azure 75 | azure-functions-maven-plugin 76 | ${azure.functions.maven.plugin.version} 77 | 78 | 79 | org.apache.maven.plugins 80 | maven-resources-plugin 81 | 3.1.0 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-dependency-plugin 86 | 3.1.1 87 | 88 | 89 | 90 | 91 | 92 | 93 | com.microsoft.azure 94 | azure-functions-maven-plugin 95 | 96 | ${functionResourceGroup} 97 | ${functionAppName} 98 | ${functionAppRegion} 99 | 100 | 101 | FUNCTIONS_EXTENSION_VERSION 102 | beta 103 | 104 | 105 | 106 | 107 | 108 | package-functions 109 | 110 | package 111 | 112 | 113 | 114 | 115 | 116 | org.apache.maven.plugins 117 | maven-resources-plugin 118 | 119 | 120 | copy-resources 121 | package 122 | 123 | copy-resources 124 | 125 | 126 | true 127 | ${stagingDirectory} 128 | 129 | 130 | ${project.basedir} 131 | 132 | host.json 133 | local.settings.json 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | org.apache.maven.plugins 143 | maven-dependency-plugin 144 | 145 | 146 | copy-dependencies 147 | prepare-package 148 | 149 | copy-dependencies 150 | 151 | 152 | ${stagingDirectory}/lib 153 | false 154 | false 155 | true 156 | runtime 157 | azure-functions-java-library 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /CSharpOddOrEven/Function.runsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | .\TestResults 8 | 9 | 11 | x86 12 | 13 | false 14 | 15 | true 16 | 17 | 18 | 21 | 22 | 0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 34 | 40 | 41 | 48 | 49 | 50 | 51 | 52 | .*csharpoddoreven.dll$ 53 | 54 | 55 | .*csharpoddoreven.tests.* 56 | .*CPPUnitTestFramework.* 57 | .*TestAdapter.* 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | ^Fabrikam\.UnitTest\..* 66 | ^std::.* 67 | ^ATL::.* 68 | .*::__GetTestMethodInfo.* 69 | ^Microsoft::VisualStudio::CppCodeCoverageFramework::.* 70 | ^Microsoft::VisualStudio::CppUnitTestFramework::.* 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | ^System.Diagnostics.DebuggerHiddenAttribute$ 79 | ^System.Diagnostics.DebuggerNonUserCodeAttribute$ 80 | ^System.Runtime.CompilerServices.CompilerGeneratedAttribute$ 81 | ^System.CodeDom.Compiler.GeneratedCodeAttribute$ 82 | ^System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute$ 83 | ^NUnit.Framework.TestFixtureAttribute$ 84 | ^Xunit.FactAttribute$ 85 | ^Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute$ 86 | 87 | 88 | 89 | 90 | 91 | 92 | .*\\atlmfc\\.* 93 | .*\\vctools\\.* 94 | .*\\public\\sdk\\.* 95 | .*\\microsoft sdks\\.* 96 | .*\\vc\\include\\.* 97 | 98 | 99 | 100 | 101 | 102 | 103 | .*microsoft.* 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | ^B77A5C561934E089$ 112 | ^B03F5F7F11D50A3A$ 113 | ^31BF3856AD364E35$ 114 | ^89845DCD8080CC91$ 115 | ^71E9BCE111E9429C$ 116 | ^8F50407C4E9E73B6$ 117 | ^E361AF139669C375$ 118 | 119 | 120 | 121 | 122 | 123 | True 124 | True 125 | True 126 | False 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 140 | 141 | 142 | 143 | 144 | 145 | True 146 | false 147 | False 148 | False 149 | 150 | 153 | 154 | 155 | 156 | 171 | 172 | -------------------------------------------------------------------------------- /JavaScriptOddOrEven/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "javascriptoddoreven", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@sinonjs/formatio": { 8 | "version": "2.0.0", 9 | "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", 10 | "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", 11 | "dev": true, 12 | "requires": { 13 | "samsam": "1.3.0" 14 | } 15 | }, 16 | "@sinonjs/samsam": { 17 | "version": "2.0.0", 18 | "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.0.0.tgz", 19 | "integrity": "sha512-D7VxhADdZbDJ0HjUTMnSQ5xIGb4H2yWpg8k9Sf1T08zfFiQYlaxM8LZydpR4FQ2E6LZJX8IlabNZ5io4vdChwg==", 20 | "dev": true 21 | }, 22 | "ansi-regex": { 23 | "version": "3.0.0", 24 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", 25 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", 26 | "dev": true 27 | }, 28 | "axios": { 29 | "version": "0.18.0", 30 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz", 31 | "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", 32 | "requires": { 33 | "follow-redirects": "^1.3.0", 34 | "is-buffer": "^1.1.5" 35 | } 36 | }, 37 | "balanced-match": { 38 | "version": "1.0.0", 39 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 40 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 41 | "dev": true 42 | }, 43 | "brace-expansion": { 44 | "version": "1.1.11", 45 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 46 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 47 | "dev": true, 48 | "requires": { 49 | "balanced-match": "^1.0.0", 50 | "concat-map": "0.0.1" 51 | } 52 | }, 53 | "browser-stdout": { 54 | "version": "1.3.1", 55 | "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", 56 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", 57 | "dev": true 58 | }, 59 | "charenc": { 60 | "version": "0.0.2", 61 | "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", 62 | "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", 63 | "dev": true 64 | }, 65 | "commander": { 66 | "version": "2.15.1", 67 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", 68 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", 69 | "dev": true 70 | }, 71 | "concat-map": { 72 | "version": "0.0.1", 73 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 74 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 75 | "dev": true 76 | }, 77 | "crypt": { 78 | "version": "0.0.2", 79 | "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", 80 | "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", 81 | "dev": true 82 | }, 83 | "debug": { 84 | "version": "3.1.0", 85 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 86 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 87 | "requires": { 88 | "ms": "2.0.0" 89 | } 90 | }, 91 | "diff": { 92 | "version": "3.5.0", 93 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 94 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 95 | "dev": true 96 | }, 97 | "escape-string-regexp": { 98 | "version": "1.0.5", 99 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 100 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 101 | "dev": true 102 | }, 103 | "follow-redirects": { 104 | "version": "1.5.2", 105 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.2.tgz", 106 | "integrity": "sha512-kssLorP/9acIdpQ2udQVTiCS5LQmdEz9mvdIfDcl1gYX2tPKFADHSyFdvJS040XdFsPzemWtgI3q8mFVCxtX8A==", 107 | "requires": { 108 | "debug": "^3.1.0" 109 | } 110 | }, 111 | "fs.realpath": { 112 | "version": "1.0.0", 113 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 114 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 115 | "dev": true 116 | }, 117 | "glob": { 118 | "version": "7.1.2", 119 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", 120 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", 121 | "dev": true, 122 | "requires": { 123 | "fs.realpath": "^1.0.0", 124 | "inflight": "^1.0.4", 125 | "inherits": "2", 126 | "minimatch": "^3.0.4", 127 | "once": "^1.3.0", 128 | "path-is-absolute": "^1.0.0" 129 | } 130 | }, 131 | "growl": { 132 | "version": "1.10.5", 133 | "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", 134 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", 135 | "dev": true 136 | }, 137 | "has-flag": { 138 | "version": "3.0.0", 139 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 140 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 141 | "dev": true 142 | }, 143 | "he": { 144 | "version": "1.1.1", 145 | "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", 146 | "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", 147 | "dev": true 148 | }, 149 | "inflight": { 150 | "version": "1.0.6", 151 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 152 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 153 | "dev": true, 154 | "requires": { 155 | "once": "^1.3.0", 156 | "wrappy": "1" 157 | } 158 | }, 159 | "inherits": { 160 | "version": "2.0.3", 161 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 162 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 163 | "dev": true 164 | }, 165 | "is-buffer": { 166 | "version": "1.1.6", 167 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", 168 | "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" 169 | }, 170 | "isarray": { 171 | "version": "0.0.1", 172 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", 173 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", 174 | "dev": true 175 | }, 176 | "just-extend": { 177 | "version": "1.1.27", 178 | "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", 179 | "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", 180 | "dev": true 181 | }, 182 | "lodash.get": { 183 | "version": "4.4.2", 184 | "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", 185 | "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", 186 | "dev": true 187 | }, 188 | "lolex": { 189 | "version": "2.7.1", 190 | "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.1.tgz", 191 | "integrity": "sha512-Oo2Si3RMKV3+lV5MsSWplDQFoTClz/24S0MMHYcgGWWmFXr6TMlqcqk/l1GtH+d5wLBwNRiqGnwDRMirtFalJw==", 192 | "dev": true 193 | }, 194 | "md5": { 195 | "version": "2.2.1", 196 | "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", 197 | "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", 198 | "dev": true, 199 | "requires": { 200 | "charenc": "~0.0.1", 201 | "crypt": "~0.0.1", 202 | "is-buffer": "~1.1.1" 203 | } 204 | }, 205 | "minimatch": { 206 | "version": "3.0.4", 207 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 208 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 209 | "dev": true, 210 | "requires": { 211 | "brace-expansion": "^1.1.7" 212 | } 213 | }, 214 | "minimist": { 215 | "version": "0.0.8", 216 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 217 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 218 | "dev": true 219 | }, 220 | "mkdirp": { 221 | "version": "0.5.1", 222 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 223 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 224 | "dev": true, 225 | "requires": { 226 | "minimist": "0.0.8" 227 | } 228 | }, 229 | "mocha": { 230 | "version": "5.2.0", 231 | "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", 232 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", 233 | "dev": true, 234 | "requires": { 235 | "browser-stdout": "1.3.1", 236 | "commander": "2.15.1", 237 | "debug": "3.1.0", 238 | "diff": "3.5.0", 239 | "escape-string-regexp": "1.0.5", 240 | "glob": "7.1.2", 241 | "growl": "1.10.5", 242 | "he": "1.1.1", 243 | "minimatch": "3.0.4", 244 | "mkdirp": "0.5.1", 245 | "supports-color": "5.4.0" 246 | } 247 | }, 248 | "mocha-junit-reporter": { 249 | "version": "1.17.0", 250 | "resolved": "https://registry.npmjs.org/mocha-junit-reporter/-/mocha-junit-reporter-1.17.0.tgz", 251 | "integrity": "sha1-LlFJ7UD8XS48px5C21qx/snG2Fw=", 252 | "dev": true, 253 | "requires": { 254 | "debug": "^2.2.0", 255 | "md5": "^2.1.0", 256 | "mkdirp": "~0.5.1", 257 | "strip-ansi": "^4.0.0", 258 | "xml": "^1.0.0" 259 | }, 260 | "dependencies": { 261 | "debug": { 262 | "version": "2.6.9", 263 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 264 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 265 | "dev": true, 266 | "requires": { 267 | "ms": "2.0.0" 268 | } 269 | } 270 | } 271 | }, 272 | "moxios": { 273 | "version": "0.4.0", 274 | "resolved": "https://registry.npmjs.org/moxios/-/moxios-0.4.0.tgz", 275 | "integrity": "sha1-/A2ixlR31yXKa5Z51YNw7QxS9Ts=", 276 | "dev": true 277 | }, 278 | "ms": { 279 | "version": "2.0.0", 280 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 281 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 282 | }, 283 | "nise": { 284 | "version": "1.4.2", 285 | "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.2.tgz", 286 | "integrity": "sha512-BxH/DxoQYYdhKgVAfqVy4pzXRZELHOIewzoesxpjYvpU+7YOalQhGNPf7wAx8pLrTNPrHRDlLOkAl8UI0ZpXjw==", 287 | "dev": true, 288 | "requires": { 289 | "@sinonjs/formatio": "^2.0.0", 290 | "just-extend": "^1.1.27", 291 | "lolex": "^2.3.2", 292 | "path-to-regexp": "^1.7.0", 293 | "text-encoding": "^0.6.4" 294 | } 295 | }, 296 | "once": { 297 | "version": "1.4.0", 298 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 299 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 300 | "dev": true, 301 | "requires": { 302 | "wrappy": "1" 303 | } 304 | }, 305 | "path-is-absolute": { 306 | "version": "1.0.1", 307 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 308 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 309 | "dev": true 310 | }, 311 | "path-to-regexp": { 312 | "version": "1.7.0", 313 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", 314 | "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", 315 | "dev": true, 316 | "requires": { 317 | "isarray": "0.0.1" 318 | } 319 | }, 320 | "samsam": { 321 | "version": "1.3.0", 322 | "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", 323 | "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", 324 | "dev": true 325 | }, 326 | "sinon": { 327 | "version": "6.1.4", 328 | "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.1.4.tgz", 329 | "integrity": "sha512-NFEts+4D4jp2sBjL94fQpZk5o73kzn/g58+I9Dp15i9vsnT4Lk1UEyUf2jACODWLG6Pz/llF0sArYUw47Aarmg==", 330 | "dev": true, 331 | "requires": { 332 | "@sinonjs/formatio": "^2.0.0", 333 | "@sinonjs/samsam": "^2.0.0", 334 | "diff": "^3.5.0", 335 | "lodash.get": "^4.4.2", 336 | "lolex": "^2.7.1", 337 | "nise": "^1.4.2", 338 | "supports-color": "^5.4.0", 339 | "type-detect": "^4.0.8" 340 | } 341 | }, 342 | "strip-ansi": { 343 | "version": "4.0.0", 344 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 345 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", 346 | "dev": true, 347 | "requires": { 348 | "ansi-regex": "^3.0.0" 349 | } 350 | }, 351 | "supports-color": { 352 | "version": "5.4.0", 353 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", 354 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", 355 | "dev": true, 356 | "requires": { 357 | "has-flag": "^3.0.0" 358 | } 359 | }, 360 | "text-encoding": { 361 | "version": "0.6.4", 362 | "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", 363 | "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", 364 | "dev": true 365 | }, 366 | "type-detect": { 367 | "version": "4.0.8", 368 | "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", 369 | "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", 370 | "dev": true 371 | }, 372 | "wrappy": { 373 | "version": "1.0.2", 374 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 375 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 376 | "dev": true 377 | }, 378 | "xml": { 379 | "version": "1.0.1", 380 | "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", 381 | "integrity": "sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=", 382 | "dev": true 383 | } 384 | } 385 | } 386 | --------------------------------------------------------------------------------