Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created December 4, 2016 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/a137c143ce8d1f880962d07f4066df97 to your computer and use it in GitHub Desktop.
Save guitarrapc/a137c143ce8d1f880962d07f4066df97 to your computer and use it in GitHub Desktop.
Should be fail with TestShouldFailFunction
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Amazon.Lambda.Core;
using Amazon.Lambda.TestUtilities;
using SimpleAsyncFunction;
namespace SimpleAsyncFunction.Tests
{
public class FunctionTest
{
[Fact]
public async Task TestToUpperFunction()
{
// Invoke the lambda function and confirm the string was upper cased.
var function = new Function();
var context = new TestLambdaContext();
var upperCase = await function.FunctionHandlerAsync("hello world", context);
Assert.Equal("HELLO WORLD", upperCase);
}
[Fact]
public async Task TestToLowerFunction()
{
// Invoke the lambda function and confirm the string was upper cased.
var function = new Function();
var context = new TestLambdaContext();
var upperCase = await function.FunctionHandlerAsync("hello world", context);
Assert.NotEqual("hello world", upperCase);
}
[Fact]
public async Task TestShouldFailFunction()
{
// Invoke the lambda function and confirm the string was upper cased.
var function = new Function();
var context = new TestLambdaContext();
var upperCase = await function.FunctionHandlerAsync("hello world", context);
Assert.Equal("hogemoge", upperCase);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment