Skip to content

Commit 48efca4

Browse files
committed
removed generic CanSupply from IAnonymousValueSupplier
1 parent c57abec commit 48efca4

8 files changed

Lines changed: 1 addition & 47 deletions

TestStack.Dossier/AnonymousValueFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public T Get<TObject, T>(Expression<Func<TObject, T>> property)
8686
var valueSupplier = LocalValueSuppliers
8787
.Concat(GlobalValueSuppliers)
8888
.Concat(DefaultValueSuppliers)
89-
.First(s => s.CanSupplyValue<TObject, T>(propertyName));
89+
.First(s => s.CanSupplyValue(typeof(T), propertyName));
9090

9191
return valueSupplier.GenerateAnonymousValue<TObject, T>(this, propertyName);
9292
}

TestStack.Dossier/IAnonymousValueSupplier.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ namespace TestStack.Dossier
77
/// </summary>
88
public interface IAnonymousValueSupplier
99
{
10-
/// <summary>
11-
/// Returns whether or not this supplier can supply an anonymous value for the given property.
12-
/// </summary>
13-
/// <typeparam name="TObject">The type that the property is enclosed in</typeparam>
14-
/// <typeparam name="TValue">The type of the target property - the anonymous value will need to be of this type</typeparam>
15-
/// <param name="propertyName">The name of the property to generate a value for</param>
16-
/// <returns>Whether or not this supplier can supply an anonymous value</returns>
17-
bool CanSupplyValue<TObject, TValue>(string propertyName);
18-
1910
/// <summary>
2011
/// Returns whether or not this supplier can supply an anonymous value for the given property.
2112
/// </summary>

TestStack.Dossier/Suppliers/DefaultEmailValueSupplier.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ namespace TestStack.Dossier.Suppliers
88
/// </summary>
99
public class DefaultEmailValueSupplier : IAnonymousValueSupplier
1010
{
11-
/// <inheritdoc />
12-
public bool CanSupplyValue<TObject, TValue>(string propertyName)
13-
{
14-
return CanSupplyValue(typeof(string), propertyName);
15-
}
16-
1711
/// <inheritdoc />
1812
public bool CanSupplyValue(Type type, string propertyName)
1913
{

TestStack.Dossier/Suppliers/DefaultFirstNameValueSupplier.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ namespace TestStack.Dossier.Suppliers
88
/// </summary>
99
public class DefaultFirstNameValueSupplier : IAnonymousValueSupplier
1010
{
11-
/// <inheritdoc />
12-
public bool CanSupplyValue<TObject, TValue>(string propertyName)
13-
{
14-
return CanSupplyValue(typeof (TValue), propertyName);
15-
}
16-
1711
/// <inheritdoc />
1812
public bool CanSupplyValue(Type type, string propertyName)
1913
{

TestStack.Dossier/Suppliers/DefaultLastNameValueSupplier.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ namespace TestStack.Dossier.Suppliers
88
/// </summary>
99
public class DefaultLastNameValueSupplier : IAnonymousValueSupplier
1010
{
11-
/// <inheritdoc />
12-
public bool CanSupplyValue<TObject, TValue>(string propertyName)
13-
{
14-
return typeof (TValue) == typeof(string) &&
15-
(propertyName.ToLower() == "lastname" || propertyName.ToLower() == "surname");
16-
}
17-
1811
/// <inheritdoc />
1912
public bool CanSupplyValue(Type type, string propertyName)
2013
{

TestStack.Dossier/Suppliers/DefaultStringValueSupplier.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ namespace TestStack.Dossier.Suppliers
88
/// </summary>
99
public class DefaultStringValueSupplier : IAnonymousValueSupplier
1010
{
11-
/// <inheritdoc />
12-
public bool CanSupplyValue<TObject, TValue>(string propertyName)
13-
{
14-
return typeof (TValue) == typeof(string);
15-
}
16-
1711
/// <inheritdoc />
1812
public bool CanSupplyValue(Type type, string propertyName)
1913
{

TestStack.Dossier/Suppliers/DefaultValueSupplier.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ namespace TestStack.Dossier.Suppliers
77
/// </summary>
88
public class DefaultValueSupplier : IAnonymousValueSupplier
99
{
10-
/// <inheritdoc />
11-
public bool CanSupplyValue<TObject, TValue>(string propertyName)
12-
{
13-
return true;
14-
}
15-
1610
/// <inheritdoc />
1711
public bool CanSupplyValue(Type type, string propertyName)
1812
{

TestStack.Dossier/Suppliers/DefaultValueTypeValueSupplier.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ namespace TestStack.Dossier.Suppliers
1010
/// </summary>
1111
public class DefaultValueTypeValueSupplier : IAnonymousValueSupplier
1212
{
13-
/// <inerhitdoc />
14-
public bool CanSupplyValue<TObject, TValue>(string propertyName)
15-
{
16-
return typeof (TValue).IsValueType;
17-
}
18-
1913
/// <inerhitdoc />
2014
public bool CanSupplyValue(Type type, string propertyName)
2115
{

0 commit comments

Comments
 (0)