Exemplo n.º 1
0
 private static ISafeBytes GetSut(ISafeByteCollection collection = null,
                                  ISafeByteFactory factory       = null, IFactory <ISafeBytes> safeBytesFactory = null)
 {
     return(new SafeBytes(
                factory ?? Stubs.Get <ISafeByteFactory>(),
                safeBytesFactory ?? Stubs.GetFactory <ISafeBytes>(),
                Stubs.GetFactory(collection)));
 }
Exemplo n.º 2
0
 internal SafeBytes(
     ISafeByteFactory safeByteFactory,
     IFactory <ISafeBytes> safeBytesFactory,
     IFactory <ISafeByteCollection> safeByteCollectionFactory)
 {
     _safeByteFactory    = safeByteFactory ?? throw new ArgumentNullException(nameof(safeByteFactory));
     _safeBytesFactory   = safeBytesFactory ?? throw new ArgumentNullException(nameof(safeBytesFactory));
     _safeByteCollection = safeByteCollectionFactory.Create();
 }
Exemplo n.º 3
0
 internal SafeBytes(
     IFastRandom fastRandom,
     ISafeByteFactory safeByteFactory,
     IFactory <ISafeBytes> safeBytesFactory,
     IFactory <ISafeByteCollection> safeByteCollectionFactory)
 {
     if (fastRandom == null)
     {
         throw new ArgumentNullException(nameof(fastRandom));
     }
     if (safeByteFactory == null)
     {
         throw new ArgumentNullException(nameof(safeByteFactory));
     }
     if (safeBytesFactory == null)
     {
         throw new ArgumentNullException(nameof(safeBytesFactory));
     }
     _fastRandom            = fastRandom;
     _safeByteFactory       = safeByteFactory;
     _safeBytesInstantiator = safeBytesFactory;
     _safeByteCollection    = safeByteCollectionFactory.Create();
 }