Ejemplo n.º 1
0
 public void WhenAdaptNotInitialized_ThenThrows()
 {
     Assert.Throws <InvalidOperationException>(() => Adapt.To <string>(Mock.Of <ICloneable>()));
 }
Ejemplo n.º 2
0
        public void WhenAdaptInitializedTwice_ThenThrows()
        {
            Adapt.Initialize(Mock.Of <IAdapterService>());

            Assert.Throws <InvalidOperationException>(() => Adapt.Initialize(Mock.Of <IAdapterService>()));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes the <see cref="Adapt"/> static facade with
        /// the specified service.
        /// </summary>
        /// <param name="service">The adapter service to use on the <see cref="Adapt"/> class.</param>
        public static void Initialize(Lazy <IAdapterService> service)
        {
            Guard.NotNull(() => service, service);

            Adapt.Initialize(service);
        }