public MemoryRepositorySimpleTests() { _database = new MemoryDatabase(); var databaseProvider = Substitute.For<IMemoryDatabaseProvider>(); databaseProvider.Database.Returns(_database); _repository = new MemoryRepository<TestEntity>(databaseProvider); // Testing Insert by creating initial data _repository.Insert(new TestEntity("test1")); _repository.Insert(new TestEntity("test2")); _database.Set<TestEntity>().Count.ShouldBe(2); }
public MemoryRepository_Simple_Tests() { _database = new MemoryDatabase(); var databaseProvider = Substitute.For<IMemoryDatabaseProvider<int, long>>(); databaseProvider.Database.Returns(_database); _repository = new MemoryRepository<MyEntity, int, long>(databaseProvider); //Testing Insert by creating initial data _repository.Insert(new MyEntity("test-1")); _repository.Insert(new MyEntity("test-2")); _database.Set<MyEntity>().Count.ShouldBe(2); }
public MemoryRepository_Simple_Tests() { _database = new MemoryDatabase(); var databaseProvider = Substitute.For <IMemoryDatabaseProvider>(); databaseProvider.Database.Returns(_database); _repository = new MemoryRepository <MyEntity>(databaseProvider); //Testing Insert by creating initial data _repository.Insert(new MyEntity("test-1")); _repository.Insert(new MyEntity("test-2")); _database.Set <MyEntity>().Count.ShouldBe(2); }
public MemoryRepository(MemoryDatabase db) { _db = db; Set = _db.Set <T>(); }