Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
 internal static void Create_UndefinedGenericsThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create(typeof(ConstraintSample <,>)));
 }
Exemplo n.º 4
0
 internal static void Create_PointersThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create(typeof(void *)));
 }
Exemplo n.º 5
0
 internal static void Create_SealedTypesThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <string>());
 }
Exemplo n.º 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> >());
 }
Exemplo n.º 7
0
 internal static void Create_IFakedFunctional()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <IFaked>().FakeMeta);
 }
Exemplo n.º 8
0
 internal static void Create_OnlyMultipleInterfaces()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <DataSample>(typeof(object)));
 }
Exemplo n.º 9
0
 internal static void Create_IFakedDefault()
 {
     Tools.Asserter.Is(true, Subclasser.Create <object>() is IFaked);
     Tools.Asserter.IsNot(null, Subclasser.Create(null, null));
 }
Exemplo n.º 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)));
 }
Exemplo n.º 11
0
 internal static void Create_ClassesWork()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <AbstractFakeSample>());
     Tools.Asserter.IsNot(null, Subclasser.Create <VirtualFakeSample>());
 }
Exemplo n.º 12
0
 internal static void Create_InterfacesWork()
 {
     Tools.Asserter.IsNot(null, Subclasser.Create <IFakeSample>());
     Tools.Asserter.IsNot(null, Subclasser.Create <IFakeSample>(typeof(IClashingFakeSample)));
 }
Exemplo n.º 13
0
 internal static void Create_InternalTypesThrow()
 {
     Tools.Asserter.Throws <ArgumentException>(() => Subclasser.Create <InternalSample>());
 }