コード例 #1
0
        /// <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));
        }
コード例 #2
0
        /// <inheritdoc/>
        public Fake Mock(Type parent, params Type[] interfaces)
        {
            IFaked provider = Subclasser.Create(parent, interfaces);

            provider.FakeMeta.Valuer = _valuer;
            return(new Fake(provider));
        }
コード例 #3
0
 internal static void Create_UndefinedGenericsThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create(typeof(ConstraintSample <,>)));
 }
コード例 #4
0
 internal static void Create_PointersThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create(typeof(void *)));
 }
コード例 #5
0
 internal static void Create_SealedTypesThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <string>());
 }
コード例 #6
0
 internal static void Create_DefinedGenericsWork()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <ConstraintSample <int, DataSample> >());
     Tools.Asserter.IsNot(null, Subclasser.Create <ConstraintSample <bool, DataSample> >());
 }
コード例 #7
0
 internal static void Create_IFakedFunctional()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <IFaked>().FakeMeta);
 }
コード例 #8
0
 internal static void Create_OnlyMultipleInterfaces()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <DataSample>(typeof(object)));
 }
コード例 #9
0
 internal static void Create_IFakedDefault()
 {
     Tools.Asserter.Is(true, Subclasser.Create <object>() is IFaked);
     Tools.Asserter.IsNot(null, Subclasser.Create(null, null));
 }
コード例 #10
0
 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)));
 }
コード例 #11
0
 internal static void Create_ClassesWork()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <AbstractFakeSample>());
     Tools.Asserter.IsNot(null, Subclasser.Create <VirtualFakeSample>());
 }
コード例 #12
0
 internal static void Create_InterfacesWork()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <IFakeSample>());
     Tools.Asserter.IsNot(null, Subclasser.Create <IFakeSample>(typeof(IClashingFakeSample)));
 }
コード例 #13
0
 internal static void Create_InternalTypesThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <InternalSample>());
 }