Пример #1
0
 public void WhenAdaptNotInitialized_ThenThrows()
 {
     Assert.Throws <InvalidOperationException>(() => Adapt.To <string>(Mock.Of <ICloneable>()));
 }
Пример #2
0
        public void WhenAdaptInitializedTwice_ThenThrows()
        {
            Adapt.Initialize(Mock.Of <IAdapterService>());

            Assert.Throws <InvalidOperationException>(() => Adapt.Initialize(Mock.Of <IAdapterService>()));
        }
Пример #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);
        }