Beispiel #1
0
 public OfferingResultWriter(IOfferingResultWriterConfiguration configuration, ISerializer serializer, IDeserializer deserializer, IHttpClientCreator httpClientCreator, IAuthTokenGenerator authTokenGenerator)
 {
     _configuration      = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _httpClientCreator  = httpClientCreator ?? throw new ArgumentNullException(nameof(httpClientCreator));
     _serializer         = serializer ?? throw new ArgumentNullException(nameof(serializer));
     _deserializer       = deserializer ?? throw new ArgumentNullException(nameof(deserializer));
     _authTokenGenerator = authTokenGenerator ?? throw new ArgumentNullException(nameof(authTokenGenerator));
 }
Beispiel #2
0
        public void When_Configuration_Is_Null_Then_Constructor_Throws_ArgumentNullException()
        {
            // set up
            IOfferingResultWriterConfiguration configuration = null;

            // execute
            var ex = Assert.Throws <ArgumentNullException>(() => new OfferingResultWriter(configuration, _serializer.Object, _deserializer.Object, _httpClientCreator.Object, _authTokenGenerator.Object, _vendorCredentials.Object));

            // verify
            Assert.Equal("configuration", ex.ParamName);
        }
Beispiel #3
0
 public OfferingResultWriter(IOfferingResultWriterConfiguration configuration, ISerializer serializer, IDeserializer deserializer, IHttpClientCreator httpClientCreator, IAuthTokenGenerator authTokenGenerator, IVendorCredentials defaultCredentials) : this(configuration, serializer, deserializer, httpClientCreator, authTokenGenerator)
 {
     _defaultCredentials = defaultCredentials;
 }