-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched from TinyIoc to Autofac and added a new mechanism for object…
… mothers
- Loading branch information
1 parent
63e5661
commit f7939b2
Showing
26 changed files
with
451 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
|
||
namespace Chill | ||
{ | ||
/// <summary> | ||
/// Represents an object mother that is automatically discovered by Chill to construct test objects | ||
/// whenever you request one using <see cref="TestBase.The{T}"/>. | ||
/// </summary> | ||
public interface IObjectMother | ||
{ | ||
/// <summary> | ||
/// Gets a value indicating whether this object mother is supposed to be used as a fallback in a case | ||
/// a more specific object mother is not available. | ||
/// </summary> | ||
bool IsFallback { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether this object mother can build objects of the specified <paramref name="type"/>. | ||
/// </summary> | ||
bool Applies(Type type); | ||
|
||
/// <summary> | ||
/// Creates a test instance that is of, inherits from or implements the specified <paramref name="type"/>. | ||
/// </summary> | ||
/// <remarks> | ||
/// The implementation can use the provided <paramref name="objectResolver"/> to get other objects | ||
/// from either Chill's configured container or another object mother. | ||
/// </remarks> | ||
object Create(Type type, IChillObjectResolver objectResolver); | ||
} | ||
|
||
public interface IChillObjectResolver | ||
{ | ||
/// <summary> | ||
/// Gets a value of the specified type from the container, optionally registered under a key. | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="key">The key.</param> | ||
/// <returns></returns> | ||
T Get<T>(string key = null) where T : class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.