Пример #1
0
        private static T CreateFake(Action <IFakeOptions <T> > optionsBuilder)
        {
            Guard.AgainstNull(optionsBuilder, nameof(optionsBuilder));

            return((T)FakeAndDummyManager.CreateFake(
                       typeof(T),
                       options => optionsBuilder((IFakeOptions <T>)options),
                       new LoopDetectingResolutionContext()));
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Fake{T}"/> class.
 /// Creates a new fake object.
 /// </summary>
 public Fake()
 {
     this.FakedObject = (T)FakeAndDummyManager.CreateFake(typeof(T), new LoopDetectingResolutionContext());
 }
Пример #3
0
        private static T CreateFake(Action <IFakeOptions <T> > optionsBuilder)
        {
            Guard.AgainstNull(optionsBuilder, nameof(optionsBuilder));

            return((T)FakeAndDummyManager.CreateFake(typeof(T), options => optionsBuilder((IFakeOptions <T>)options)));
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Fake{T}"/> class.
 /// Creates a new fake object.
 /// </summary>
 public Fake()
 {
     this.FakedObject = (T)FakeAndDummyManager.CreateFake(typeof(T), null);
 }