Exemplo n.º 1
0
        public void BuildArgs_Should_Add_Default_Arguments()
        {
            // Arrange
            var awsOptions = new AwsOptions { AccessKey = "key" };

            DateTime now = DateTime.UtcNow;
            string timestamp = now.ToString();
            var dateTimeProvider = CreateDateTimeProvider(now);

            var argumentBuilder = CreateArgumentBuilder(awsOptions, dateTimeProvider);

            // Act
            var args = argumentBuilder.BuildArgs(new SearchCriteria());

            // Assert
            args.Should().Contain("AWSAccessKeyId", awsOptions.AccessKey)
                .And.Contain("Service", "AWSECommerceService")
                .And.Contain("Condition", "All")
                .And.Contain("Timestamp", timestamp);
        }
Exemplo n.º 2
0
 public AwsArgumentBuilder(AwsOptions awsOptions, IDateTimeProvider dateTimeProvider, ITagGenerator generator)
 {
     _awsOptions = awsOptions;
     _dateTimeProvider = dateTimeProvider;
     _generator = generator;
 }
Exemplo n.º 3
0
        private static IArgumentBuilder CreateArgumentBuilder(AwsOptions awsOptions = null,
															  IDateTimeProvider dateTimeProvider = null,
															  ITagGenerator generator = null)
        {
            return new AwsArgumentBuilder(awsOptions ?? new AwsOptions(),
                                          dateTimeProvider ?? CreateDateTimeProvider(DateTime.UtcNow),
                                          generator ?? CreateGenerator());
        }