public void UpdateTest() { var repository = new InMemoryRepository<TestClass>(x => x.Key); repository.Store(new TestClass()); repository.Update(new { Value2 = DateTime.MaxValue }, 1); var val = repository.Find(1).Object; Assert.AreEqual(val.Value2, DateTime.MaxValue); var obj = new { Value2 = DateTime.MaxValue }; repository.Update(obj, x => x.Property, 1); Assert.AreEqual(val.Property.Value2, DateTime.MaxValue); Assert.AreEqual(val.Property.Value1.Value, 1); }
public void Run() { var efRepository = new EntityFrameworkRepository<Person>(new DbContext(String.Empty)); var allPeople = efRepository.GetAll(); var personRepository = new PersonRepository(new DbContext(String.Empty)); var children = personRepository.GetChildren(); var memoryRepository = new InMemoryRepository<Person>(); memoryRepository.Add(new Person { Id = 42, Age = 10, Name = "Artanis" }); }