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
public class ObjectUnderTest | |
{ | |
private string _prefix; | |
public ObjectUnderTest(string prefix) | |
{ | |
_prefix = prefix; | |
} |
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
public class ObjectUnderTest | |
{ | |
private readonly MappingEngine mappingEngine; | |
public ObjectUnderTest(string prefix) | |
{ | |
var configuration = new Configuration(new TypeMapFactory(), MapperRegistry.AllMappers()); | |
configuration.CreateMap<Person, PersonModel>() | |
.ForMember(x => x.Name, y => y.MapFrom(orig => prefix + orig.Name)); |
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
void Main() | |
{ | |
var people = new []{ | |
new Person() { Id = 1, FirstName = "Darren", LastName = "Cauthon", IsAFanOfAynRand = true, IsACoolPerson = true}, | |
new Person() { Id = 2, FirstName = "Caleb", LastName = "Cauthon", IsAFanOfAynRand = true, IsACoolPerson = false}, | |
new Person() { Id = 3, FirstName = "Evan", LastName = "Cauthon", IsAFanOfAynRand = false, IsACoolPerson = true}, | |
}; | |
var unreadable = new UnreadableCoolAynRandFanRetriever(people); | |
var readable = new ReadableCoolAynRandFanRetriever(people); |
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
public class IdRetriever { | |
private IEnumerable<Person> people; | |
public IdRetriever(IEnumerable<Person> people){ | |
this.people = people; | |
} | |
public IEnumerable<int> GetIds(){ | |
return GetTheIds() |
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
public class CatalogContextDeterminer | |
{ | |
private XPrincipal principal; | |
public CatalogContextDeterminer(XPrincipal principal) | |
{ | |
principal = principal; | |
} | |
public Type GetCatalogContextType() |
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
//First the usage | |
//Would be cool to use it for taking out parameters from a table, when I only use a few parameters and don't have a real class | |
[Given(@"the following Dealer exists")] | |
public void GivenTheFollowingDealerExists(DynamicItems people) | |
{ | |
var person = people.First(); | |
string Id = Convert.ToInt32(person.Id); | |
string Name = person.Name; | |
// do your stuff |
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
public class UserRepository | |
{ | |
private readonly IDataStore _store; | |
private readonly IEncryption _encryption; | |
public UserRepository(IDataStore store, IEncryption encryption) | |
{ | |
_store = store; | |
_encryption = encryption; | |
} |
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
public class UserRepository | |
{ | |
private readonly IDataStore dataStore; | |
private readonly IEncryption encryption; | |
public UserRepository(IDataStore dataStore, IEncryption encryption) | |
{ | |
this.dataStore = dataStore; | |
this.encryption = encryption; | |
} |
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
public class Tests | |
{ | |
private AutoMoqer mocker; | |
[SetUp] | |
public void Setup() | |
{ | |
mocker = new AutoMoqer(); | |
mocker.GetMock<IEncryption>() |
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
public class AppRuntime : SimpleCqrsRuntime<UnityServiceLocator> | |
{ | |
private readonly string connectionString; | |
public AppRuntime(string connectionString) | |
{ | |
this.connectionString = connectionString; | |
} | |
protected override IEventStore GetEventStore(IServiceLocator serviceLocator) |
OlderNewer