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))); }
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(); }
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(); }