Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5.  
  6. using Xunit;
  7. using Amazon.Lambda.Core;
  8. using Amazon.Lambda.TestUtilities;
  9.  
  10. using SimpleAsyncFunction;
  11.  
  12. namespace SimpleAsyncFunction.Tests
  13. {
  14. public class FunctionTest
  15. {
  16. [Fact]
  17. public async Task TestToUpperFunction()
  18. {
  19. // Invoke the lambda function and confirm the string was upper cased.
  20. var function = new Function();
  21. var context = new TestLambdaContext();
  22. var upperCase = await function.FunctionHandlerAsync("hello world", context);
  23.  
  24. Assert.Equal("HELLO WORLD", upperCase);
  25. }
  26.  
  27. [Fact]
  28. public async Task TestToLowerFunction()
  29. {
  30. // Invoke the lambda function and confirm the string was upper cased.
  31. var function = new Function();
  32. var context = new TestLambdaContext();
  33. var upperCase = await function.FunctionHandlerAsync("hello world", context);
  34.  
  35. Assert.NotEqual("hello world", upperCase);
  36. }
  37.  
  38. [Fact]
  39. public async Task TestShouldFailFunction()
  40. {
  41. // Invoke the lambda function and confirm the string was upper cased.
  42. var function = new Function();
  43. var context = new TestLambdaContext();
  44. var upperCase = await function.FunctionHandlerAsync("hello world", context);
  45.  
  46. Assert.Equal("hogemoge", upperCase);
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement