-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify ServiceComponentList (#2566)
- Loading branch information
Showing
7 changed files
with
91 additions
and
96 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
22 changes: 13 additions & 9 deletions
22
TechTalk.SpecFlow/Assist/SpecFlowDefaultValueComparerList.cs
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 |
---|---|---|
@@ -1,18 +1,22 @@ | ||
using TechTalk.SpecFlow.Assist.ValueComparers; | ||
using System.Collections.Generic; | ||
using TechTalk.SpecFlow.Assist.ValueComparers; | ||
|
||
namespace TechTalk.SpecFlow.Assist | ||
{ | ||
public class SpecFlowDefaultValueComparerList : ServiceComponentList<IValueComparer> | ||
#nullable enable | ||
internal sealed class SpecFlowDefaultValueComparerList : ServiceComponentList<IValueComparer> | ||
{ | ||
public SpecFlowDefaultValueComparerList() | ||
: base(new List<IValueComparer> { | ||
new DateTimeValueComparer(), | ||
new BoolValueComparer(), | ||
new GuidValueComparer(), | ||
new DecimalValueComparer(), | ||
new DoubleValueComparer(), | ||
new FloatValueComparer(), | ||
new DefaultValueComparer(), | ||
}, true) | ||
{ | ||
Register(new DateTimeValueComparer()); | ||
Register(new BoolValueComparer()); | ||
Register(new GuidValueComparer()); | ||
Register(new DecimalValueComparer()); | ||
Register(new DoubleValueComparer()); | ||
Register(new FloatValueComparer()); | ||
SetDefault(new DefaultValueComparer()); | ||
} | ||
} | ||
} |
54 changes: 29 additions & 25 deletions
54
TechTalk.SpecFlow/Assist/SpecFlowDefaultValueRetrieverList.cs
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 |
---|---|---|
@@ -1,34 +1,38 @@ | ||
using TechTalk.SpecFlow.Assist.ValueRetrievers; | ||
using System.Collections.Generic; | ||
using TechTalk.SpecFlow.Assist.ValueRetrievers; | ||
|
||
namespace TechTalk.SpecFlow.Assist | ||
{ | ||
internal class SpecFlowDefaultValueRetrieverList : ServiceComponentList<IValueRetriever> | ||
#nullable enable | ||
internal sealed class SpecFlowDefaultValueRetrieverList : ServiceComponentList<IValueRetriever> | ||
{ | ||
public SpecFlowDefaultValueRetrieverList() | ||
: base(new List<IValueRetriever> { | ||
// Sorted by likelihood | ||
new StringValueRetriever(), | ||
new IntValueRetriever(), | ||
new BoolValueRetriever(), | ||
new LongValueRetriever(), | ||
new FloatValueRetriever(), | ||
new DoubleValueRetriever(), | ||
new DateTimeValueRetriever(), | ||
new TimeSpanValueRetriever(), | ||
new GuidValueRetriever(), | ||
new EnumValueRetriever(), | ||
new ListValueRetriever(), | ||
new ArrayValueRetriever(), | ||
new ByteValueRetriever(), | ||
new SByteValueRetriever(), | ||
new UIntValueRetriever(), | ||
new ShortValueRetriever(), | ||
new UShortValueRetriever(), | ||
new ULongValueRetriever(), | ||
new DecimalValueRetriever(), | ||
new CharValueRetriever(), | ||
new DateTimeOffsetValueRetriever(), | ||
new UriValueRetriever() | ||
}, false) | ||
{ | ||
Register(new StringValueRetriever()); | ||
Register(new ByteValueRetriever()); | ||
Register(new SByteValueRetriever()); | ||
Register(new IntValueRetriever()); | ||
Register(new UIntValueRetriever()); | ||
Register(new ShortValueRetriever()); | ||
Register(new UShortValueRetriever()); | ||
Register(new LongValueRetriever()); | ||
Register(new ULongValueRetriever()); | ||
Register(new FloatValueRetriever()); | ||
Register(new DoubleValueRetriever()); | ||
Register(new DecimalValueRetriever()); | ||
Register(new CharValueRetriever()); | ||
Register(new BoolValueRetriever()); | ||
Register(new DateTimeValueRetriever()); | ||
Register(new GuidValueRetriever()); | ||
Register(new EnumValueRetriever()); | ||
Register(new TimeSpanValueRetriever()); | ||
Register(new DateTimeOffsetValueRetriever()); | ||
Register(new UriValueRetriever()); | ||
|
||
Register(new ArrayValueRetriever()); | ||
Register(new ListValueRetriever()); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
3.9.52 | ||
|
||
Changes: | ||
+ improve Service.GetValueRetrieverFor performance | ||
|
||
3.9.40 | ||
|
||
Changes: | ||
|