コード例 #1
0
 internal static void Issue004_MockCanCallBaseD(Fake <BaseHolder> sample, int value)
 {
     sample.Setup(d => d.GetValueD(value), Behavior.Base <BaseHolder>());
     sample.Dummy.GetValueD(value);
     sample.Dummy.ValueHolder.Assert().Is(value);
     sample.VerifyAll();
 }
コード例 #2
0
 internal static void Issue004_MockCallBaseAbstractInvalid(Fake <BaseHolder> sample)
 {
     sample.Setup(d => d.GetValueUnset(), Behavior.Base <BaseHolder>());
     Tools.Asserter.Throws <InvalidOperationException>(() => sample.Dummy.GetValueUnset());
 }
コード例 #3
0
 internal static void Issue004_MockCanCallBaseThrow(Fake <BaseHolder> sample, Exception e)
 {
     sample.Setup(d => d.ThrowError(e), Behavior.Base <BaseHolder>());
     Tools.Asserter.Throws <Exception>(() => sample.Dummy.ThrowError(e)).Assert().Is(e);
     sample.VerifyAll();
 }
コード例 #4
0
 internal static void Issue004_MockCanCallBaseA(Fake <BaseHolder> sample)
 {
     sample.Setup(d => d.GetValueA(), Behavior.Base <BaseHolder, int>());
     sample.Dummy.GetValueA().Assert().Is(BaseHolder._TestValue);
     sample.VerifyAll();
 }
コード例 #5
0
 internal static void Issue004_MockCallBaseWrongTypeInvalid(Fake <IBaseHolder> sample)
 {
     sample.Setup(d => d.GetValueUnset(), Behavior.Base <string>());
     Tools.Asserter.Throws <MissingMethodException>(() => sample.Dummy.GetValueUnset());
 }