Beispiel #1
0
        public EFRepository(IPortfolioCmsDbContext context)
        {
            Guard.WhenArgument(context, "Db context is null!").IsNull().Throw();

            this.context = context;
            this.dbSet   = this.context.Set <T>();
        }
Beispiel #2
0
        public void ThrowArgumentNullException_WhenDbContextParameterIsNull()
        {
            IPortfolioCmsDbContext nullContext = null;

            Assert.That(
                () => new UnitOfWork.UnitOfWork(nullContext),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("Db context is null!"));
        }
Beispiel #3
0
        public void ShouldThrowArgumentNullException_WhenIPetsWonderlandDbContextIsNull()
        {
            // Arrange
            IPortfolioCmsDbContext nullContext = null;

            // Act & Assert
            Assert.That(
                () => new EFRepository <IProject>(nullContext),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("Db context is null!"));
        }
Beispiel #4
0
        public UnitOfWork(IPortfolioCmsDbContext context)
        {
            Guard.WhenArgument(context, "Db context is null!").IsNull().Throw();

            this.context = context;
        }