コード例 #1
0
ファイル: MockException.cs プロジェクト: seiya1223/moq4
 private static string GetMessage(MockBehavior behavior, Invocation invocation, string message)
 {
     return(string.Format(
                CultureInfo.CurrentCulture,
                Resources.MockExceptionMessage,
                invocation.ToString(),
                behavior,
                message
                ));
 }
コード例 #2
0
ファイル: MockException.cs プロジェクト: zb2470/moq4
 /// <summary>
 ///   Returns the exception to be thrown when a strict mock has no setup that provides a return value for the specified invocation.
 /// </summary>
 internal static MockException ReturnValueRequired(Invocation invocation)
 {
     return(new MockException(
                MockExceptionReason.ReturnValueRequired,
                string.Format(
                    CultureInfo.CurrentCulture,
                    Resources.MockExceptionMessage,
                    invocation.ToString(),
                    MockBehavior.Strict,
                    Resources.ReturnValueRequired)));
 }
コード例 #3
0
ファイル: MockException.cs プロジェクト: zb2470/moq4
 /// <summary>
 ///   Returns the exception to be thrown when a strict mock has no setup corresponding to the specified invocation.
 /// </summary>
 internal static MockException NoSetup(Invocation invocation)
 {
     return(new MockException(
                MockExceptionReason.NoSetup,
                string.Format(
                    CultureInfo.CurrentCulture,
                    Resources.MockExceptionMessage,
                    invocation.ToString(),
                    MockBehavior.Strict,
                    Resources.NoSetup)));
 }