public ISession Create()
        {
            ISessionOptions    sessionOptions    = _sessionOptions ?? new SessionOptions();
            IConfig            config            = new Config(_configOptions ?? new ConfigOptions());
            ISessionReflection sessionReflection = new SessionReflection();

            return(new Session(sessionOptions, config, sessionReflection));
        }
        public ISession Create()
        {
            var sessionOptions    = new SessionOptions(_awsAccessKeyId, _awsAccessKey, _awsSessionToken, _regionName);
            var config            = new Config(_localStackHost);
            var sessionReflection = new SessionReflection();

            return(new Session(sessionOptions, config, sessionReflection));
        }
示例#3
0
        public void SetForcePathStyle_Should_Return_False_If_Given_ClientConfig_Does_Not_Have_ForcePathStyle()
        {
            var sessionReflection = new SessionReflection();
            var clientConfig      = new MockClientConfig();

            bool set = sessionReflection.SetForcePathStyle(clientConfig, true);

            Assert.False(set);
        }
示例#4
0
        public void CreateClientConfig_Should_Create_ClientConfig_By_Given_Generic_Service_Client_Type()
        {
            var sessionReflection = new SessionReflection();

            ClientConfig clientConfig = sessionReflection.CreateClientConfig <MockAmazonServiceClient>();

            Assert.NotNull(clientConfig);
            Assert.IsType <MockClientConfig>(clientConfig);
        }
示例#5
0
        public void ExtractServiceMetadata_Should_Return_Extracted_ServiceMetadata()
        {
            var sessionReflection = new SessionReflection();

            IServiceMetadata serviceMetadata = sessionReflection.ExtractServiceMetadata <MockAmazonServiceClientWithServiceMetadata>();

            Assert.NotNull(serviceMetadata);
            Assert.Equal(MockServiceMetadata.MockServiceId, serviceMetadata.ServiceId);
        }
示例#6
0
        public void SetForcePathStyle_Should_Set_ForcePathStyle_Of_ClientConfig_If_It_Exists()
        {
            var sessionReflection = new SessionReflection();
            var clientConfig      = new MockClientConfigWithForcePathStyle();

            Assert.False(clientConfig.ForcePathStyle);

            bool set = sessionReflection.SetForcePathStyle(clientConfig, true);

            Assert.True(set);
            Assert.True(clientConfig.ForcePathStyle);
        }
示例#7
0
        public void ExtractServiceMetadata_Should_Throw_InvalidOperationException_If_Given_Generic_Service_Client_Type_Has_Not_Service_Metadata_Field()
        {
            var sessionReflection = new SessionReflection();

            Assert.Throws <InvalidOperationException>(() => sessionReflection.ExtractServiceMetadata <MockAmazonServiceClient>());
        }