/// <inheritdoc/> public Fake <T> Mock <T>(params Type[] interfaces) { IFaked provider = Subclasser.Create(typeof(T), interfaces); provider.FakeMeta.Valuer = _valuer; return(new Fake <T>(provider)); }
/// <inheritdoc/> public Fake Mock(Type parent, params Type[] interfaces) { IFaked provider = Subclasser.Create(parent, interfaces); provider.FakeMeta.Valuer = _valuer; return(new Fake(provider)); }
internal static void Create_UndefinedGenericsThrow() { Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create(typeof(ConstraintSample <,>))); }
internal static void Create_PointersThrow() { Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create(typeof(void *))); }
internal static void Create_SealedTypesThrow() { Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <string>()); }
internal static void Create_DefinedGenericsWork() { Tools.Asserter.IsNot(null, Subclasser.Create <ConstraintSample <int, DataSample> >()); Tools.Asserter.IsNot(null, Subclasser.Create <ConstraintSample <bool, DataSample> >()); }
internal static void Create_IFakedFunctional() { Tools.Asserter.IsNot(null, Subclasser.Create <IFaked>().FakeMeta); }
internal static void Create_OnlyMultipleInterfaces() { Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <DataSample>(typeof(object))); }
internal static void Create_IFakedDefault() { Tools.Asserter.Is(true, Subclasser.Create <object>() is IFaked); Tools.Asserter.IsNot(null, Subclasser.Create(null, null)); }
internal static void Create_BothWork() { Tools.Asserter.IsNot(null, Subclasser.Create <AbstractFakeSample>(typeof(IFakeSample))); Tools.Asserter.IsNot(null, Subclasser.Create <VirtualFakeSample>( typeof(IFakeSample), typeof(IClashingFakeSample))); }
internal static void Create_ClassesWork() { Tools.Asserter.IsNot(null, Subclasser.Create <AbstractFakeSample>()); Tools.Asserter.IsNot(null, Subclasser.Create <VirtualFakeSample>()); }
internal static void Create_InterfacesWork() { Tools.Asserter.IsNot(null, Subclasser.Create <IFakeSample>()); Tools.Asserter.IsNot(null, Subclasser.Create <IFakeSample>(typeof(IClashingFakeSample))); }
internal static void Create_InternalTypesThrow() { Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <InternalSample>()); }