Skip to content

Commit b968b2e

Browse files
authored
Merge pull request #449 from Azure/vabhog/addPSSamplesTests
Creates PowerShell Samples / Tests
2 parents 2325767 + 0fb6f30 commit b968b2e

File tree

59 files changed

+1206
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1206
-8
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,4 +358,7 @@ __queuestorage__
358358
__azurite_db*__.json
359359

360360
# Python virtual environment
361-
.venv
361+
.venv
362+
363+
# Mac OS X
364+
.DS_Store

builds/azure-pipelines/template-steps-build-test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ steps:
1212
inputs:
1313
useGlobalJson: true
1414

15+
# Install .Net Core 3.1.0 as PowerShell tests are unable to find 3.1.0 framework to run tests
16+
- task: UseDotNet@2
17+
displayName: 'Install .NET Core 3.1 sdk'
18+
inputs:
19+
packageType: sdk
20+
version: '3.1.x'
21+
1522
# Run Policheck early to avoid scanning dependency folders
1623
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2
1724
displayName: 'Run PoliCheck'

samples/samples-csharp/Common/Product.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ public class ProductWithOptionalId
3434
public class ProductName
3535
{
3636
public string Name { get; set; }
37+
38+
public override bool Equals(object obj)
39+
{
40+
if (obj is Product)
41+
{
42+
var that = obj as Product;
43+
return this.Name == that.Name;
44+
}
45+
return false;
46+
}
3747
}
3848

3949
public class ProductWithDefaultPK
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git*
2+
.vscode
3+
local.settings.json
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Azure Functions artifacts
2+
bin
3+
obj
4+
appsettings.json
5+
local.settings.json
6+
7+
# Azurite artifacts
8+
__blobstorage__
9+
__queuestorage__
10+
__azurite_db*__.json
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"ms-azuretools.vscode-azurefunctions",
4+
"ms-vscode.powershell"
5+
]
6+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to PowerShell Functions",
6+
"type": "PowerShell",
7+
"request": "attach",
8+
"customPipeName": "AzureFunctionsPSWorker",
9+
"runspaceId": 1,
10+
"preLaunchTask": "func: host start"
11+
}
12+
]
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"azureFunctions.templateFilter": "All",
3+
"azureFunctions.deploySubpath": ".",
4+
"azureFunctions.projectLanguage": "PowerShell",
5+
"azureFunctions.projectRuntime": "~4",
6+
"debug.internalConsoleOptions": "neverOpen"
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "func",
6+
"command": "host start",
7+
"problemMatcher": "$func-powershell-watch",
8+
"isBackground": true
9+
}
10+
]
11+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"bindings": [
3+
{
4+
"authLevel": "function",
5+
"name": "Request",
6+
"direction": "in",
7+
"type": "httpTrigger",
8+
"methods": [
9+
"post"
10+
],
11+
"route": "addproduct"
12+
},
13+
{
14+
"name": "response",
15+
"type": "http",
16+
"direction": "out"
17+
},
18+
{
19+
"name": "product",
20+
"type": "sql",
21+
"direction": "out",
22+
"commandText": "[dbo].[Products]",
23+
"connectionStringSetting": "SqlConnectionString"
24+
}
25+
],
26+
"disabled": false
27+
}

0 commit comments

Comments
 (0)