An implementation of Unit of Work that can be used in tests.
Inheritance: BaseUnitOfWork, IUnitOfWork
Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MockRepository" /> class.
 /// </summary>
 /// <param name="unitOfWork">The unit of work.</param>
 /// <param name="serializationProvider">The serialization provider.</param>
 /// <param name="seedData">The seed data.</param>
 public MockRepository(MockUnitOfWork unitOfWork, ISerializationProvider serializationProvider, IEnumerable <IEntity> seedData)
     : this()
 {
     this.UnitOfWork = unitOfWork;
     this.UnitOfWork.AddRepository(this);
     this._data                  = seedData.ToList();
     this._initialData           = serializationProvider.SerializeObject(seedData);
     this._serializationProvider = serializationProvider;
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MockRepository" /> class.
 /// </summary>
 /// <param name="unitOfWork">The unit of work.</param>
 /// <param name="serializationProvider">The serialization provider.</param>
 public MockRepository(MockUnitOfWork unitOfWork, ISerializationProvider serializationProvider)
     : this(unitOfWork, serializationProvider, new List <IEntity>())
 {
 }
Esempio n. 3
0
 public MockRepository(IMessageProvider messageProvider, MockUnitOfWork unitOfWork, ISerializationProvider serializationProvider)
     : this(messageProvider, unitOfWork, serializationProvider, new List <IEntity>())
 {
 }
Esempio n. 4
0
 public MockRepository(IMessageProvider messageProvider, MockUnitOfWork unitOfWork, ISerializationProvider serializationProvider, IEnumerable <IEntity> seedData)
     : this(unitOfWork, serializationProvider, seedData)
 {
 }