Example #1
0
        public void Dispose_RemovedDbSets()
        {
            // Arrange
            _mockContext = new MockEfContext(typeof(TestEntity));

            // Act
            _mockContext.Object.Dispose();

            // Assert
            Assert.ThrowsException <NullReferenceException>(() => _mockContext.GetDbSet <TestEntity>(), "The dbset should not exist once the context has been disposed.");
        }
Example #2
0
 public void Initialize()
 {
     _mockContext = new MockEfContext(typeof(TestCompany));
     _repository  = new EfRepository <TestCompany>(_mockContext.Object);
     _service     = new ConcreteCompanyService <TestCompany>(_repository);
 }
Example #3
0
 public void Initialize()
 {
     _mockContext = new MockEfContext(typeof(TestEntity));
 }
 public void Initialize()
 {
     _mockContext = new MockEfContext(typeof(TestQuote));
     _repository  = new EfRepository <TestQuote>(_mockContext.Object);
     _service     = new QuoteService <TestQuote>(_repository);
 }
        public void Initialize()
        {
            var _mockContext = new MockEfContext(typeof(TestEntity)).Object;

            _repository = new EfRepository <TestEntity>(_mockContext);
        }
Example #6
0
 public void Initialize()
 {
     _mockContext = new MockEfContext(typeof(TestNetworkConfiguration));
     _repository  = new EfRepository <TestNetworkConfiguration>(_mockContext.Object);
     _service     = new NetworkConfigurationService <TestNetworkConfiguration>(_repository);
 }