public LibrarySystemEfWrapper(ILibrarySystemEfDbContext context)
        {
            Guard.WhenArgument(context, "context").IsNull().Throw();

            this.Context = context;
            this.DbSet   = this.Context.Set <T>();
        }
示例#2
0
        public void ThrowArgumentNullException_WhenPassedContextIsNull()
        {
            // Arrange
            ILibrarySystemEfDbContext context = null;

            // Act & Assert
            Assert.That(() => new LibrarySystemEfWrapper <IBook>(context),
                        Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("context"));
        }
        public void Constructor_ShouldThrowArgumentNullException_WhenContextIsNull()
        {
            // Arrange
            ILibrarySystemEfDbContext context = null;

            // Act & Assert
            Assert.That(
                () => new LibrarySystemEfDbContextSaveChanges(context),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("context"));
        }
示例#4
0
        public LibrarySystemEfDbContextSaveChanges(ILibrarySystemEfDbContext context)
        {
            Guard.WhenArgument(context, "context").IsNull().Throw();

            this.context = context;
        }