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);
        }
Exemple #2
0
 public AwsArgumentBuilder(AwsOptions awsOptions, IDateTimeProvider dateTimeProvider, ITagGenerator generator)
 {
     _awsOptions = awsOptions;
     _dateTimeProvider = dateTimeProvider;
     _generator = generator;
 }
        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());
        }