예제 #1
0
        public void Build_SetsStatement_WhenAllowAllMethodsWasCalled()
        {
            _testObject.AllowAllMethods();

            var actual = _testObject.Build(_standardArn);

            Assert.Single(actual.PolicyDocument.Statement);

            var statement = actual.PolicyDocument.Statement.Single();

            Assert.Equal("Allow", statement.Effect);
            Assert.Single(statement.Action);
            Assert.Contains("execute-api:Invoke", statement.Action);
            Assert.Single(statement.Resource);
            Assert.Contains($"arn:partition:service:region:awsAccountId:restApiId/stage/*/*", statement.Resource);
        }