コード例 #1
0
        public void TestGreeting()
        {
            TestLambdaContext context   = new TestLambdaContext();
            IAmazonS3         s3Client  = new AmazonS3Client(RegionEndpoint.USEast1);
            StepFunctionTasks functions = new StepFunctionTasks(s3Client);

            var state = new State();

            CWEvent cwevent = new CWEvent
            {
                region  = "us-east-1",
                account = "573575823092",
                detail  = new CWEvent.Detail
                {
                    userIdentity = new CWEvent.Detail.UserIdentity
                    {
                        account  = "",
                        userName = "",
                        arn      = ""
                    },
                    requestParameters = new CWEvent.Detail.RequestParameters
                    {
                        bucketName = "siri-sandbox-bucket-1-us-east-1",
                        key        = "booksSchemaFail.xml"
                    }
                }
            };

            state = functions.XMLValidate(cwevent, context);

            Assert.Equal(5, state.WaitInSeconds);
            Assert.Equal(false, state.XMLValid);
        }
コード例 #2
0
        public void TestByeBye()
        {
            TestLambdaContext context = new TestLambdaContext();

            StepFunctionTasks functions = new StepFunctionTasks();

            var state = new State
            {
                Name = "MyStepFunctions"
            };


            state = functions.ByeBye(state, context);

            Assert.Equal(", Goodbye1 MyStepFunctions", state.Message);
        }
コード例 #3
0
ファイル: FunctionTest.cs プロジェクト: ACGAshwin/accoona.io
        public void TestGreeting()
        {
            TestLambdaContext context = new TestLambdaContext();

            StepFunctionTasks functions = new StepFunctionTasks();

            var state = new State
            {
                Name = "MyStepFunctions"
            };


            state = functions.Greeting(state, context);

            Assert.Equal(5, state.WaitInSeconds);
            Assert.Equal("Hello MyStepFunctions", state.Message);
        }
コード例 #4
0
        public void TestCalc()
        {
            TestLambdaContext context = new TestLambdaContext();

            StepFunctionTasks functions = new StepFunctionTasks();

            var state = new State
            {
                Input1 = "4",
                Input2 = "3"
            };


            state = functions.Calculation(state, context);

            Assert.Equal(3, state.WaitInSeconds);
            Assert.Equal("7", state.Result);
        }
コード例 #5
0
        public void TestRecordVisit()
        {
            TestLambdaContext context = new TestLambdaContext();

            StepFunctionTasks functions = new StepFunctionTasks();

            var state = new State
            {
                Name = "MyStepFunctions"
            };

            var content = new StringBuilder();
            var writer  = new StringWriter(content);

            Console.SetOut(writer);

            state = functions.RecordVisit(state, context).GetAwaiter().GetResult();

            Assert.Equal("MyStepFunctions visited us", content.ToString());
        }