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())); }
/// <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()); }
private static T CreateFake(Action <IFakeOptions <T> > optionsBuilder) { Guard.AgainstNull(optionsBuilder, nameof(optionsBuilder)); return((T)FakeAndDummyManager.CreateFake(typeof(T), options => optionsBuilder((IFakeOptions <T>)options))); }
/// <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); }