Esempio n. 1
0
 private static string GetMessage(MockBehavior behavior, Invocation invocation, string message)
 {
     return(string.Format(
                CultureInfo.CurrentCulture,
                Resources.MockExceptionMessage,
                invocation.ToString(),
                behavior,
                message
                ));
 }
Esempio n. 2
0
 /// <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)));
 }
Esempio n. 3
0
 /// <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)));
 }