Esempio n. 1
0
		/// <summary>
		/// Assert a method on an exported mock.
		/// </summary>
		/// <typeparam name="TObject">The type of the exported mock.</typeparam>
		/// <param name="this">The mocking container.</param>
		/// <param name="expression">The method to assert.</param>
		public static void Assert<TObject>(this MockExportProvider @this, Expression<Func<TObject, object>> expression)
		{
			@this.GetExportedValue<TObject>().Assert(expression);
		}
Esempio n. 2
0
		/// <summary>
		/// Assert an exported mock.
		/// </summary>
		/// <typeparam name="TObject">The type of the exported mock.</typeparam>
		/// <param name="this">The mocking container.</param>
		public static void Assert<TObject>(this MockExportProvider @this)
		{
			@this.GetExportedValue<TObject>().Assert();
		}
Esempio n. 3
0
		/// <summary>
		/// Export a mocked type and arrange a method on it.
		/// </summary>
		/// <typeparam name="TObject">The type of mock to export.</typeparam>
		/// <param name="this">The mocking container.</param>
		/// <param name="contractName">The contract name of the mock export.</param>
		/// <param name="expression">The method to arrange.</param>
		/// <param name="metadata">Optional metadata to identify the export.</param>
		/// <returns>Fluent interface to further configure the behavior of this arrangement.</returns>
		public static ActionExpectation Arrange<TObject>(this MockExportProvider @this, string contractName, Expression<Action<TObject>> expression, IDictionary<string, object> metadata = null)
		{
			return @this.ExportMock<TObject>(contractName, metadata).Arrange(expression);
		}
Esempio n. 4
0
		/// <summary>
		/// Export a mocked type and arrange a method on it.
		/// </summary>
		/// <typeparam name="TObject">The type of mock to export.</typeparam>
		/// <param name="this">The mocking container.</param>
		/// <param name="expression">The method to arrange.</param>
		/// <param name="metadata">Optional metadata to identify the export.</param>
		/// <returns>Fluent interface to further configure the behavior of this arrangement.</returns>
		public static ActionExpectation Arrange<TObject>(this MockExportProvider @this, Expression<Action<TObject>> expression, IDictionary<string, object> metadata = null)
		{
			return @this.Arrange(null, expression, metadata);
		}
Esempio n. 5
0
		/// <summary>
		/// Assert a method on an exported mock.
		/// </summary>
		/// <typeparam name="TObject">The type of the exported mock.</typeparam>
		/// <param name="this">The mocking container.</param>
		/// <param name="contractName">The contract name identifying the exported mock.</param>
		/// <param name="expression">The method to assert.</param>
		/// <param name="occurs">Occurrence expectation.</param>
		public static void Assert<TObject>(this MockExportProvider @this, string contractName, Expression<Action<TObject>> expression, Occurs occurs)
		{
			@this.GetExportedValue<TObject>(contractName).Assert(expression, occurs);
		}
Esempio n. 6
0
		/// <summary>
		/// Assert a method on an exported mock.
		/// </summary>
		/// <typeparam name="TObject">The type of the exported mock.</typeparam>
		/// <param name="this">The mocking container.</param>
		/// <param name="contractName">The contract name identifying the exported mock.</param>
		/// <param name="expression">The method to assert.</param>
		public static void Assert<TObject>(this MockExportProvider @this, string contractName, Expression<Func<TObject, object>> expression)
		{
			@this.GetExportedValue<TObject>(contractName).Assert(expression);
		}
Esempio n. 7
0
		/// <summary>
		/// Assert an exported mock.
		/// </summary>
		/// <typeparam name="TObject">The type of the exported mock.</typeparam>
		/// <param name="this">The mocking container.</param>
		/// <param name="contractName">The contract name identifying the exported mock.</param>
		public static void Assert<TObject>(this MockExportProvider @this, string contractName)
		{
			@this.GetExportedValue<TObject>(contractName).Assert();
		}