Skip to content

Instantly share code, notes, and snippets.

<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AWSProjectType>Lambda</AWSProjectType>
<!-- This property makes the build directory similar to a publish directory and helps the AWS .NET Lambda Mock Test Tool find project dependencies. -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<PublishReadyToRun>true</PublishReadyToRun>
<TrimMode>true</TrimMode>
import axios from 'axios';
import { LogFactory, Logger, LogService, MangaLaterFunction, IdentityIAM, IdentitySTS, UserIAM, UserSTS, LogMessageTypes } from '@manga-later/sdk-javascript';
import { Context, CloudFormationCustomResourceEvent, CloudFormationCustomResourceResponse } from 'aws-lambda';
import AWSXRay from 'aws-xray-sdk';
import aws from 'aws-sdk';
const AWS = AWSXRay.captureAWS(aws);
export const SecureStringHandler = async (event: CloudFormationCustomResourceEvent, context: Context): Promise<void> => {
import 'mocha';
import { expect } from 'chai';
import { PostApp } from '../../src/apps/post-app';
import { TodoItem } from '../../src/models/todo-item';
import { TodoRepository } from '../../src/models/todo-repository';
import { ApiGatewayResponse } from '../../src/models/apigateway/apigateway-response';
import { ApiGatewayEventMock } from '../models/apigateway-event-mock';
describe('PostApp instance', () => {
import 'mocha';
import { expect } from 'chai';
import * as sinon from 'sinon';
import { DynamoDB } from 'aws-sdk';
import { handler } from '../../src/handlers/post-item';
import { ApiGatewayResponse } from '../../src/models/apigateway/apigateway-response';
import { ApiGatewayEventMock } from '../models/apigateway-event-mock';
const CloudFormation = require('yaml-cfn')
// Extract the AWS::Serverless::Function Resources as they
// are the entires we need to compile.
const { Resources } = CloudFormation.yamlParse(fs.readFileSync('template.yml'))
const entries = Object.values(Resources)
.filter(resource => resource.Type == 'AWS::Serverless::Function')
.filter(resource => resource.Properties.Runtime.startsWith('dotnetcore'))
.map(resource => {
public class ProjectEntity
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid TrackerId { get; set; }
public string Title { get; set; }
public bool IsFlagged { get; set; }
@scionwest
scionwest / DatabaseAppFactory`1.cs
Created June 3, 2019 19:42
Generate Databases per Integration Test
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.AspNetCore.TestHost;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
public class Connection
{
Socket connection;
IPublisher publisher;
public Connection(IPublisher publisher, Socket connection)
{
this.publisher = publisher;
this.connection = connection;
}
using System;
using System.Threading;
using System.Threading.Tasks;
namespace MudDesigner.Engine.Core
{
/// <summary>
/// <para>
/// The Engine Timer allows for starting a timer that will execute a callback at a given interval.
/// </para>
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
namespace FuncContravarianceIssue
{
[TestClass]
public class UnitTest1
{
private class Foo
{